Repository navigation
Support battery powered Matter cameras - #3314
samadDotDev wants to merge 2 commits into
Conversation
|
Profile category check: ✅ Passed - all profiles have a category defined. |
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 73 files 545 suites 0s ⏱️ Results for commit 7c748c7. ♻️ This comment has been updated with latest results. |
|
matter-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 7c748c7 |
|
Question on |
Good question and valid concern! There can be multiple instances of power source cluster indeed, per spec
I have added that handling in 7c748c7 |
| function CameraAttributeHandlers.bat_charge_state_handler(driver, device, ib, response) | ||
| local state = camera_fields.BAT_CHARGE_STATE_MAP[ib.data.value] | ||
| if state then | ||
| device:emit_event_for_endpoint(ib, capabilities.chargingState.chargingState[state]()) |
There was a problem hiding this comment.
| device:emit_event_for_endpoint(ib, capabilities.chargingState.chargingState[state]()) | |
| device:emit_event_for_endpoint(ib, capabilities.chargingState.chargingState(state)) |
nit, but this is the syntax we use for everything else, so maybe we leave that here as well.
Description of Change
In order to support battery powered Matter Cameras, we need to add these 3 capabilities to the profile:
battery(to expose battery %)batteryLevel(to expose levels such as "critical", "warning" and "normal", when the % isn't supported)chargingState(for cameras with rechargeable batteries, which is almost always the case)All 3 were added based on feature map and attributes list in Power source cluster. These have been tested with their state updates (so critical level or low % results in a notification, and the % is shown in the top-right corner of live-view player) as well as conditions of automation (e.g., a user can setup notification when camera charging is complete if unmounted etc)
Note that we only expose % capability when camera supports both % and level for the battery. This is to remain consistent with our existing usages in other Matter drivers, but it should be re-evaluated given that level has device/battery-subjective thresholds (which can vary depending on battery chemistry).
Summary of Completed Tests