Rename BUZZER to SOUND and implement proper encoding/decoding - #286
Rename BUZZER to SOUND and implement proper encoding/decoding#286its-tom wants to merge 5 commits into
Conversation
- Maps PropertyId.SOUND to 0x022C (matches buzzer_all) - Maps PropertyId.PROMPT_TONE to 0x001A (matches prompt_tone) - Updates encoding and decoding to correctly use 0x01 and 0x00 - Adds corresponding unit tests
…erty - device.beep now maps to PROMPT_TONE (0x001A) again, which triggers the beep to acknowledge the command. - Added a new device.sound property mapped to SOUND (0x022C) to toggle the global buzzer capability. - Added missing SOUND capability map and implicitly support PROMPT_TONE
- CapabilitiesResponse now exposes the sound property. - Fixed missing attribute error in device tests by using the property correctly.
|
This looks pretty good. Thanks for working on it. I made a few comments, and only saw one potential issue. For UX, I wonder if we should just merge sound/beep. I don't understand how they differ. Is beep the "old" method and sound the "new" method? Or are they controlling different things? |
|
I need to fix that docker workflow sometime too.. |
They control two different things, so we should keep them separate:
|
Yeah, but a user probably wants to achieve one thing: mute/unmute their device. They don't care which bit/byte in the protocol does it for their device. What I propose:
|
PropertyId.SOUNDto0x022C(matchesbuzzer_allfrom midea-lan)PropertyId.PROMPT_TONEto0x001A(matchesprompt_tonefrom midea-lan)0x01and0x00for these propertiesdevice.beepto map toPROMPT_TONEso that applying changes triggers an acknowledgment beep (matching the V2 protocol behavior)device.soundproperty mapped toSOUNDto allow toggling the AC's global buzzer settingRegarding mill1000/midea-ac-py#481
Original implementation: https://github.com/wuwentao/midea-lan/blob/main/midealan/devices/ac/message.py