Skip to content

Commit

Permalink
Merge pull request #1315 from jinhk7/bugfix/STSE-2617
Browse files Browse the repository at this point in the history
fix issue that Aqara Smart Plug T1 doesn't work after reonboarding
  • Loading branch information
greens authored Apr 25, 2024
2 parents 7a52cc1 + 2f9f69d commit 23e54d5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
4 changes: 2 additions & 2 deletions drivers/SmartThings/zigbee-switch/src/aqara/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ local function private_mode_handler(driver, device, value, zb_rx)
device:set_field(PRIVATE_MODE, value.value, { persist = true })

if value.value ~= 1 then
device:send(cluster_base.write_manufacturer_specific_attribute(device,
PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private
device:send(SimpleMetering.attributes.CurrentSummationDelivered:configure_reporting(device, 900, 3600, 1)) -- minimal interval : 15min
device:set_field(constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 10, { persist = true })
device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, 1000, { persist = true })
Expand Down Expand Up @@ -225,8 +227,6 @@ local function device_added(driver, device)
device:emit_event(capabilities.powerMeter.power({ value = 0.0, unit = "W" }))
device:emit_event(capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))

device:send(cluster_base.write_manufacturer_specific_attribute(device,
PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private
end

local aqara_switch_handler = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ test.register_coroutine_test(
test.socket.capability:__expect_send(
mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID
, MFG_CODE, data_types.Uint8, 1)
}
)
end
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ test.register_coroutine_test(
test.socket.capability:__expect_send(
mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID
, MFG_CODE, data_types.Uint8, 1)
}
)
end
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ local AnalogInput = clusters.AnalogInput

local MFG_CODE = 0x115F
local PRIVATE_CLUSTER_ID = 0xFCC0
local PRIVATE_ATTRIBUTE_ID = 0x0009
local RESTORE_POWER_STATE_ATTRIBUTE_ID = 0x0201
local ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID = 0x000A

Expand Down Expand Up @@ -68,13 +67,6 @@ test.register_coroutine_test(
test.socket.capability:__expect_send(
mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" }))
)
test.socket.zigbee:__expect_send(
{
mock_device.id,
cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID
, MFG_CODE, data_types.Uint8, 1)
}
)
end
)

Expand Down

0 comments on commit 23e54d5

Please sign in to comment.