Closed makleso6 closed 4 years ago
Our enums are being generated from the Homekit framework that's bundled with macOS. I've just verified, but it seems that our enums are correct based on that file. However, to be sure, I also checked the parts from the HAP specifications:
9.116 Target Humidifier Dehumidifier State
Property Value UUID 000000B4-0000-1000-8000-0026BB765291 Type public.hap.characteristic.humidifier-dehumidifier.state.target Permissions Paired Read, Notify, Paired Write Format uint8 Minimum Value 0 Maximum Value 2 Step Value 1 Valid Values 0 ”Humidifier or Dehumidifier”
1 ”Humidifier”
2 ”Dehumidifier”
And
9.29 Current Humidifier Dehumidifier State
Property Value UUID 000000B3-0000-1000-8000-0026BB765291 Type public.hap.characteristic.humidifier-dehumidifier.state.current Permissions Paired Read, Notify Format uint8 Minimum Value 0 Maximum Value 3 Step Value 1 Valid Values 0 ”Inactive”
1 ”Idle”
2 ”Humidifying”
3 ”Dehumidifying”
These are indeed in line with what you've written. After some investigation, the reason was found:
<key>HUMIDIFIER_DEHUMIDIFIER_MODE</key>
<dict>
<key>Format</key>
<string>string</string>
<key>OutValues</key>
<dict>
<key>0</key>
<string>INACTIVE</string>
<key>1</key>
<string>IDLE</string>
<key>2</key>
<string>HUMIDIFYING</string>
<key>3</key>
<string>DEHUMIDIFYING</string>
</dict>
<key>Read</key>
<string>humidifier-dehumidifier.state.current</string>
<key>Values</key>
<dict>
<key>AUTO</key>
<integer>0</integer>
<key>DEHUMIDIFY_AUTO</key>
<integer>2</integer>
<key>HUMIDIFY_AUTO</key>
<integer>1</integer>
</dict>
<key>Write</key>
<string>humidifier-dehumidifier.state.target</string>
</dict>
It appears that we're incorrectly swapping current and target state.
Thanks!
Hi! I think TargetHumidifierDehumidifierState is wrong enum
in HomeKit iOS native implementation enum represents as