Skip to content

Add support for scene mode for the aquara cube#4814

Open
Gaff wants to merge 2 commits intozigpy:devfrom
Gaff:dev
Open

Add support for scene mode for the aquara cube#4814
Gaff wants to merge 2 commits intozigpy:devfrom
Gaff:dev

Conversation

@Gaff
Copy link
Copy Markdown

@Gaff Gaff commented Mar 8, 2026

Proposed change

This PR introduces "scene mode" support for the Xiaomi Cube device, allowing it to correctly emit ZHA events for physical actions. Additionally, I have refactored and tidied up the existing logic within the base quirk to improve readability and maintainability.

Additional information

The cube device has 2 modes: Gesture, and Scene. In Gesture mode, only certain gestures (e.g. flipping) become events. In scene mode it simply records which face is up. However for the purpose of the quirks, it can simply forward on any message it receives.

I removed the "description" field in the event as it implied the event know which orientation the cube was in, which it doesn't!

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.84%. Comparing base (20a0777) to head (8a21ea5).
⚠️ Report is 38 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4814      +/-   ##
==========================================
+ Coverage   92.66%   92.84%   +0.18%     
==========================================
  Files         380      380              
  Lines       12766    12755      -11     
==========================================
+ Hits        11829    11842      +13     
+ Misses        937      913      -24     

☔ 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.

@TheJulianJES TheJulianJES added the Xiaomi Request/PR regarding a Xiaomi or Aqara device label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Xiaomi Request/PR regarding a Xiaomi or Aqara device

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants