feat: add buzzer property to control device beep on commands#136
Open
tonyputi wants to merge 1 commit intocmroche:masterfrom
Open
feat: add buzzer property to control device beep on commands#136tonyputi wants to merge 1 commit intocmroche:masterfrom
tonyputi wants to merge 1 commit intocmroche:masterfrom
Conversation
Buzzer_ON_OFF is a per-command flag (not persistent device state) that suppresses the beep when sending commands. It must be injected into every push_state_update() call, so it is stored as a client-side attribute rather than in the Props/_properties system. Default is True (buzzer enabled) to match factory device behavior. Closes cmroche#106 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #136 +/- ##
==========================================
+ Coverage 95.65% 95.71% +0.05%
==========================================
Files 8 8
Lines 760 770 +10
==========================================
+ Hits 727 737 +10
Misses 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed solution
After analyzing both positions, @namezys is technically correct:
Buzzer_ON_OFFcannot work throughProps/_propertiesbecause:_dirtylist is cleared after eachpush_state_update(), so the flag would only be sent once instead of with every commandupdate_state()unreliable for itThe implementation stores
buzzeras a client-side preference (_buzzerattribute) that gets injected into everypush_state_update()call when disabled. This correctly models the transient nature of the flag while providing a clean API surface.Key differences from #119
beepbuzzer(matches Gree protocolBuzzer_ON_OFFand HA conventions)False(breaking change!)True(preserves factory behavior)Home Assistant compatibility
This is designed to be consumed in the HA Gree integration as a
SwitchEntitywithEntityCategory.CONFIG, following the same descriptor pattern already used for light, quiet, xfan, etc.Test plan
Trueby default (factory behavior preserved)buzzer=False,Buzzer_ON_OFFis included in every commandbuzzer=True,Buzzer_ON_OFFis not sent