-
Notifications
You must be signed in to change notification settings - Fork 491
Support greater profiling for parent/child switch devices #2153
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
…all types of energy plug devices
Invitation URL: |
Test Results 67 files 440 suites 0s ⏱️ Results for commit f4892df. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against f4892df |
I like the changes here! I think it will pair well with modular profiles, which should take care of profiling for the main device but not child devices. |
Did you test with any plug devices that support energy/power clusters? |
table.sort(electrical_energy_eps) | ||
table.sort(electrical_power_eps) | ||
table.sort(switch_eps) | ||
for i, ep in ipairs(switch_eps) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop makes an assumption that the nth electrical ep will correspond to the nth switch ep, but what if only some eps support electrical power/energy, and some don't? For example, a 6 plug device with 3 outlets that support power and 1 that supports power and energy, one that supports only energy, and one that supports none. I would assume this is not a likely scenario, but a simpler combination of these factors could happen in a real device.
Overall it seems like it should not be on us as the client to try to make assumptions about which electrical endpoint corresponds to which switch endpoint. Shouldn't the electrical device type that is relevant to a given switch/plug be combined on the same endpoint? I might need to refresh myself on the spec for clarity, but it seems ambiguous if this convention is not used.
Description of Change
This PR aims to improve the dynamic profile handling of switch devices, since we have seen cases of the fingerprint being incorrect in some cases, specifically for devices that are created as parent/child.
Adding to this, it also improves the ability of devices to profile with energy cluster support. This PR handles 2 main cases that we have seen in the field (all are supported with different unit tests):
Summary of Completed Tests
Unit tests updated to support case 1. Otherwise, other tests handle these cases.
Tested on physical plug energy device.
Tested on physical multi-plug energy device.