Skip to content
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

CHAD-12653 Zigbee ColorTemperature: add dynamic range handling #1248

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

greens
Copy link
Contributor

@greens greens commented Feb 28, 2024

Uses the PhysicalMax and PhysicalMin mired values from the color control cluster to dynamically set the min/max range for zigbee bulbs in the base driver.

@greens greens requested review from ctowns and wkhenon February 28, 2024 21:54
Copy link

Copy link

github-actions bot commented Feb 28, 2024

Test Results

   56 files    360 suites   0s ⏱️
1 724 tests 1 724 ✅ 0 💤 0 ❌
3 003 runs  3 003 ✅ 0 💤 0 ❌

Results for commit 887a07a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 28, 2024

File Coverage
All files 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/preferences.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua 86%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua 70%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua 74%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 887a07a

function ()
test.socket.zigbee:__queue_receive({
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:build_test_attr_report(mock_device, 555) -- ~1800 K
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are flipped, so a good test value for ColorTempPhysicalMinMireds is 154 which is roughly 6500K and a good value for ColorTempPhysicalMaxMireds is 555 which is roughly 1800K

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. the min mireds corresponds to the max kelvin and vice versa

you are absolutely right. what cursed units

if min ~= nil and max ~= nil and min < max then
device:emit_event_for_endpoint(endpoint_id, capabilities.colorTemperature.colorTemperatureRange({ value = {minimum = min, maximum = max}}))
device:set_field(BOUND_RECEIVED..MAX, nil)
device:set_field(BOUND_RECEIVED..MAX)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
device:set_field(BOUND_RECEIVED..MAX)
device:set_field(BOUND_RECEIVED..MIN, nil)

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

@greens greens force-pushed the feature/CHAD-12653 branch from c562ba0 to 887a07a Compare March 19, 2024 23:36
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.

5 participants