Interesting case, when I read the code right. A 0 is written to the device when the sensitivity is set to 3. In which case 3 - 3 = 0 will be written. When the value is read back for validation it is set to 3 - deviceValue (0) which again verifies the 3.
So if I understand right the problem here might be that the value is exactly inverted from what one expects 3,2,1,0 instead of 0,1,2,3.
Given by the logic from current DDF:
| Sensitivity (API) | Device value |
|---|---|
| 3 | 0 |
| 2 | 1 |
| 1 | 2 |
| 0 | 3 |
