Skip to content

Comments

feat: add buzzer property to control device beep on commands#136

Open
tonyputi wants to merge 1 commit intocmroche:masterfrom
tonyputi:feature/106/add-buzzer-property
Open

feat: add buzzer property to control device beep on commands#136
tonyputi wants to merge 1 commit intocmroche:masterfrom
tonyputi:feature/106/add-buzzer-property

Conversation

@tonyputi
Copy link

@tonyputi tonyputi commented Feb 9, 2026

Proposed solution

After analyzing both positions, @namezys is technically correct: Buzzer_ON_OFF cannot work through Props/_properties because:

  1. The _dirty list is cleared after each push_state_update(), so the flag would only be sent once instead of with every command
  2. The device returns inconsistent values when reading this property, making update_state() unreliable for it
  3. Requesting an unsupported property could cause older firmware to drop the entire request

The implementation stores buzzer as a client-side preference (_buzzer attribute) that gets injected into every push_state_update() call when disabled. This correctly models the transient nature of the flag while providing a clean API surface.

Key differences from #119

Aspect PR #119 This PR
Property name beep buzzer (matches Gree protocol Buzzer_ON_OFF and HA conventions)
Default value False (breaking change!) True (preserves factory behavior)
Log message typo "nuzzer" fixed

Home Assistant compatibility

This is designed to be consumed in the HA Gree integration as a SwitchEntity with EntityCategory.CONFIG, following the same descriptor pattern already used for light, quiet, xfan, etc.

Test plan

  • Buzzer is True by default (factory behavior preserved)
  • When buzzer=False, Buzzer_ON_OFF is included in every command
  • When buzzer=True, Buzzer_ON_OFF is not sent
  • Flag is re-sent on every subsequent command (not just the first)
  • All 64 tests passing

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
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.71%. Comparing base (b6004ea) to head (1735ddf).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants