Skip to content

Commit 72a08eb

Browse files
committed
Add support Sonoff SNZB-01M Orb
#1786
1 parent 388909f commit 72a08eb

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

custom_components/sonoff/core/devices.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ def spec(cls, base: str = None, enabled: bool = None, **kwargs) -> type:
745745
XSensor, param="remoteTemperature", uid="remote_temperature", multiply=0.01
746746
),
747747
],
748+
# SNZB-01M, https://github.com/AlexxIT/SonoffLAN/issues/1786
749+
7039: [XButtonKey, Battery, ZRSSI],
748750
}
749751

750752

custom_components/sonoff/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def internal_available(self) -> bool:
374374
return self.ewelink.cloud.online
375375

376376

377-
BUTTON_STATES = ["single", "double", "hold"]
377+
BUTTON_STATES = ["single", "double", "hold", "triple"]
378378

379379

380380
class XEventSesor(XEntity, SensorEntity):

tests/test_entity.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,40 @@ def test_sonoff_r5():
778778
assert button.state == "button_3_double"
779779

780780

781+
def test_snzb_01m():
782+
# https://github.com/AlexxIT/SonoffLAN/issues/1786
783+
entities = get_entitites(
784+
[
785+
{
786+
"extra": {"uiid": 7039},
787+
"params": {
788+
"subDevId": "ffffd4a21038c1a47039",
789+
"parentid": "10022bcf8f",
790+
"subDevRssi": -45,
791+
"key": 0,
792+
"outlet": 3,
793+
"trigTime": "1777221719000",
794+
"battery": 100,
795+
"supportPowConfig": 0,
796+
"actionTime": "2026-04-26T18:23:30.000Z",
797+
},
798+
},
799+
]
800+
)
801+
802+
button: XButtonKey = next(e for e in entities if isinstance(e, XButtonKey))
803+
assert button.state == ""
804+
805+
button.ewelink.cloud.dispatcher_send(
806+
SIGNAL_UPDATE,
807+
{
808+
"deviceid": DEVICEID,
809+
"params": {"key": 3, "outlet": 2, "actionTime": "2026-05-28T11:11:16.000Z"},
810+
},
811+
)
812+
assert button.state == "button_3_triple"
813+
814+
781815
def test_zigbee_th():
782816
entities = get_entitites(
783817
{

0 commit comments

Comments
 (0)