File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
drivers/SmartThings/zigbee-button/src/aqara Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -57,17 +57,19 @@ local configuration = {
5757}
5858
5959local function present_value_attr_handler (driver , device , value , zb_rx )
60- local end_point = zb_rx .address_header .src_endpoint .value
61- local btn_evt_cnt = FINGERPRINTS [device :get_model ()].btn_cnt or 1
62- local evt = capabilities .button .button .held ({ state_change = true })
63- if value .value == 1 then
64- evt = capabilities .button .button .pushed ({ state_change = true })
65- elseif value .value == 2 then
66- evt = capabilities .button .button .double ({ state_change = true })
67- end
68- device :emit_event (evt )
69- if btn_evt_cnt > 1 then
70- device :emit_component_event (device .profile .components [COMP_LIST [end_point ]], evt )
60+ if value .value < 0xFF then
61+ local end_point = zb_rx .address_header .src_endpoint .value
62+ local btn_evt_cnt = FINGERPRINTS [device :get_model ()].btn_cnt or 1
63+ local evt = capabilities .button .button .held ({ state_change = true })
64+ if value .value == 1 then
65+ evt = capabilities .button .button .pushed ({ state_change = true })
66+ elseif value .value == 2 then
67+ evt = capabilities .button .button .double ({ state_change = true })
68+ end
69+ device :emit_event (evt )
70+ if btn_evt_cnt > 1 then
71+ device :emit_component_event (device .profile .components [COMP_LIST [end_point ]], evt )
72+ end
7173 end
7274end
7375
You can’t perform that action at this time.
0 commit comments