Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ test.register_coroutine_test(
mock_device.id,
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 0x0010)
})
test.socket.zigbee:__expect_send({
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
})
test.socket.zigbee:__expect_send({
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
})
test.socket.zigbee:__expect_send({
mock_device.id,
ColorControl.attributes.CurrentHue:configure_reporting(mock_device, 1, 3600, 0x0010)
Expand Down Expand Up @@ -377,6 +385,14 @@ test.register_coroutine_test(
mock_device.id,
SimpleMetering.attributes.Divisor:read(mock_device)
})
test.socket.zigbee:__expect_send({
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device)
})
test.socket.zigbee:__expect_send({
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device)
})

mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
end
Expand Down
12 changes: 12 additions & 0 deletions drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ test.register_coroutine_test(
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send({
mock_device.id,
zigbee_test_utils.build_bind_request(mock_device, zigbee_test_utils.mock_hub_eui, OnOff.ID)
Expand Down
12 changes: 12 additions & 0 deletions drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ test.register_coroutine_test(
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send({
mock_device.id,
zigbee_test_utils.build_bind_request(mock_device, zigbee_test_utils.mock_hub_eui, OnOff.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,24 @@ test.register_coroutine_test(
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)

test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
end
)
Expand Down Expand Up @@ -101,6 +115,22 @@ test.register_message_test(
Level.attributes.CurrentLevel:read(mock_device)
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device)
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device)
}
},
{
channel = "zigbee",
direction = "send",
Expand Down
12 changes: 12 additions & 0 deletions drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ test.register_coroutine_test(
ColorControl.attributes.CurrentSaturation:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)

test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,24 @@ test.register_coroutine_test(
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)

test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
end
)
Expand Down Expand Up @@ -108,7 +122,23 @@ test.register_message_test(
mock_device.id,
ColorControl.attributes.ColorTemperatureMireds:read(mock_device)
}
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device)
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device)
}
},
},
{
inner_block_ordering = "relaxed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,24 @@ test.register_coroutine_test(
ColorControl.attributes.ColorTemperatureMireds:configure_reporting(mock_device, 1, 3600, 16)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:configure_reporting(mock_device, 1, 43200, 1)
}
)

test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
mock_device:expect_metadata_update({ provisioning_state = "PROVISIONED" })
end
)
Expand Down Expand Up @@ -108,7 +122,23 @@ test.register_message_test(
mock_device.id,
ColorControl.attributes.ColorTemperatureMireds:read(mock_device)
}
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device)
}
},
{
channel = "zigbee",
direction = "send",
message = {
mock_device.id,
ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device)
}
},
},
{
inner_block_ordering = "relaxed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,33 @@ test.register_coroutine_test(
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
end
)

test.register_coroutine_test(
"ZLL periodic poll should occur",
function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })
test.socket.zigbee:__set_channel_ordering("relaxed")
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.wait_for_events()
"ZLL periodic poll should occur",
function()
test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" })
test.socket.zigbee:__set_channel_ordering("relaxed")
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
test.wait_for_events()

test.mock_time.advance_time(50000)
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.wait_for_events()
end,
{
test_init = function()
test.mock_device.add_test_device(mock_device)
test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "polling")
end
}
test.mock_time.advance_time(50000)
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.wait_for_events()
end,
{
test_init = function()
test.mock_device.add_test_device(mock_device)
test.timer.__create_and_queue_test_time_advance_timer(30, "interval", "polling")
end
}
)

test.register_coroutine_test(
Expand All @@ -80,6 +84,8 @@ test.register_coroutine_test(
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
end
)

Expand All @@ -96,6 +102,8 @@ test.register_coroutine_test(
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
end
)

Expand All @@ -112,6 +120,8 @@ test.register_coroutine_test(
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
end
)

Expand All @@ -129,6 +139,8 @@ test.register_coroutine_test(
test.socket.zigbee:__expect_send({ mock_device.id, OnOff.attributes.OnOff:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.CurrentLevel:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTemperatureMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMaxMireds:read(mock_device) })
test.socket.zigbee:__expect_send({ mock_device.id, ColorControl.attributes.ColorTempPhysicalMinMireds:read(mock_device) })
end
)

Expand Down
Loading
Loading