Skip to content

Commit

Permalink
Fix illuminance for Aqara Motion Sensor E1 after v4 #1322
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 6, 2024
1 parent 5d03107 commit 1410750
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/xiaomi_gateway3/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
"lumi.motion.acn001": ["Aqara", "Motion Sensor E1", "RTCGQ15LM"],
"spec": [
ConstConv("motion", "binary_sensor", mi="2.e.1", value=True),
BaseConv("illuminance", "sensor", mi="2.p.1"),
BaseConv("illuminance", "sensor", mi="2.e.1.p.1"),
BatVoltConv("battery", "sensor", mi="3.p.2"), # voltage, mV
MapConv("battery_low", "binary_sensor", mi="3.p.1", map={1: False, 2: True}), # diagnostic
],
Expand Down
6 changes: 6 additions & 0 deletions tests/test_conv_lumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,9 @@ def test_gas():
attrs = {"gas", "gas_density"}
p = device.encode_read(attrs)
assert p


def test_aqara_motion_e1():
device = XDevice("lumi.motion.acn001")
p = device.decode({"siid": 2, "eiid": 1, "arguments": [{"piid": 1, "value": 179}]})
assert p == {"illuminance": 179, "motion": True}

0 comments on commit 1410750

Please sign in to comment.