-
Notifications
You must be signed in to change notification settings - Fork 522
Matter Switch: Handle nullable case for ActivePower #2691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Invitation URL: |
Test Results 71 files 480 suites 0s ⏱️ Results for commit 540a964. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 540a964 |
|
In the spec I'm seeing that a device would report NULL for ActivePower if the power cannot be measured, not necessarily if no power is being used. Since you mentioned the issue occurs primarily on driver start/restart, should we emit 0 in device_init rather than in this NULL case? |
@nickolas-deboom I think keeping actual device actions and capability events coupled is an good principle, which is why I lean against the idea of adding this to init. And, in that same vein, I wonder whether emitting a 0 event for a null event is really what we should do either? Yes, it is an unexpected value, but it is what the device reported. I know I opened this PR (lol) but the possible unintended consequences here seem important to keep in mind... |
|
Plus there's the fact that if it was emitted during init it could cause offline devices to be marked online... definitely not a good idea 😅
Yeah I think you have a point. Are you thinking we continue to ignore Null values then? |
Description of Change
If no power is currently being used when the driver is starting or restarting, devices generally report Null as their value. This should be taken as 0.0 for a better user experience that is more consistent with other protocols.
Summary of Completed Tests
Tested on-device. Since we do not support the TLV-encoded null type in lua right now, we cannot make a unit test for this case.