-
Notifications
You must be signed in to change notification settings - Fork 546
Ledvance zigbee EM EU plug #3009
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?
Changes from all commits
c8278e8
316276d
c01a9d0
5e5a387
98aafe1
6a76283
14de7ba
99ce6ea
22bc75b
b81fa6b
328797c
8f598e7
5004c95
09b89b7
3a46f9d
b7eb6b6
6b409cb
41d31e7
28e7783
875c75f
4011278
3347541
6063c89
9424f57
2f5fe4b
d02ef90
c6d53e8
6ee58b2
2c5a233
420f963
4650e24
5e6d9d6
542e724
bea9429
d0f3ccb
d555fe4
0d04304
d25cf5c
905fe30
c4f13dd
c651f91
c81e7e3
2817eb4
14c65b3
126d24a
107f072
93d250f
aa8103b
70b6187
d1d7e2e
f62199f
73632d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,25 @@ local mock_device = test.mock_device.build_test_zigbee_device( | |
| } | ||
| ) | ||
|
|
||
| local mock_device_eu_em_t = test.mock_device.build_test_zigbee_device( | ||
| { | ||
| profile = t_utils.get_profile_definition("switch-power-energy.yml"), | ||
| zigbee_endpoints = { | ||
| [1] = { | ||
| id = 1, | ||
| manufacturer = "LEDVANCE", | ||
| model = "PLUG EU EM T", | ||
| server_clusters = { 0x0006, 0x0702 } | ||
| } | ||
| } | ||
| } | ||
| ) | ||
|
|
||
| zigbee_test_utils.prepare_zigbee_env_info() | ||
|
|
||
| local function test_init() | ||
| test.disable_startup_messages() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is one reason tests are failing (the startup messages should be disabled, otherwise init runs automatically). The other reason is because since this is now nested under the |
||
| test.mock_device.add_test_device(mock_device) | ||
| test.mock_device.add_test_device(mock_device_eu_em_t) | ||
| end | ||
|
|
||
| test.set_test_init_function(test_init) | ||
|
|
@@ -40,7 +54,7 @@ test.register_coroutine_test( | |
| assert(mock_device:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 100) | ||
| end, | ||
| { | ||
| min_api_version = 15 | ||
| min_api_version = 17 | ||
| } | ||
| ) | ||
|
|
||
|
|
@@ -55,7 +69,37 @@ test.register_coroutine_test( | |
| assert(mock_device:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 1000) | ||
| end, | ||
| { | ||
| min_api_version = 15 | ||
| min_api_version = 17 | ||
| } | ||
| ) | ||
|
|
||
| test.register_coroutine_test( | ||
| "Device init should set default multiplier and divisor only when not already set - PLUG EU EM T", | ||
| function() | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY) == nil) | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == nil) | ||
| test.socket.device_lifecycle:__queue_receive({ mock_device_eu_em_t.id, "init" }) | ||
| test.wait_for_events() | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY) == 1) | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 100) | ||
| end, | ||
| { | ||
| min_api_version = 17 | ||
| } | ||
| ) | ||
|
|
||
| test.register_coroutine_test( | ||
| "Device init should preserve device-reported multiplier and divisor - PLUG EU EM T", | ||
| function() | ||
| mock_device_eu_em_t:set_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY, 5, {persist = true}) | ||
| mock_device_eu_em_t:set_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY, 1000, {persist = true}) | ||
| test.socket.device_lifecycle:__queue_receive({ mock_device_eu_em_t.id, "init" }) | ||
| test.wait_for_events() | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY) == 5) | ||
| assert(mock_device_eu_em_t:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) == 1000) | ||
| end, | ||
| { | ||
| min_api_version = 17 | ||
| } | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| -- Copyright 2026 SmartThings, Inc. | ||
| -- Licensed under the Apache License, Version 2.0 | ||
|
|
||
| return { | ||
| { mfr = "LEDVANCE", model = "PLUG COMPACT EU EM T" }, | ||
| { mfr = "LEDVANCE", model = "PLUG EU EM T" } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.