Skip to content

Commit

Permalink
Merge pull request #1165 from Necroneco/wd1
Browse files Browse the repository at this point in the history
Add more details to Linptech Sliding Window Driver WD1
  • Loading branch information
AlexxIT committed Oct 15, 2023
2 parents 000042e + bf2defe commit 55627fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/xiaomi_gateway3/core/converters/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,9 @@
Converter("target_position", mi="2.p.3"),
CurtainPosConv("position", mi="2.p.2", parent="motor"),
Converter("battery", "sensor", mi="3.p.1"),
Converter("security_mode", "switch", mi="4.p.6"),
Converter("power_replenishment", "sensor", mi="7.p.1", enabled=None),
Converter("realtime_current_in", "sensor", mi="7.p.2", enabled=None),
],
}, {
# https://home.miot-spec.com/spec/yeelink.curtain.crc1
Expand Down
5 changes: 5 additions & 0 deletions custom_components/xiaomi_gateway3/core/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"reverse": BinarySensorDeviceClass.LOCK,
"square": BinarySensorDeviceClass.LOCK,
"water_leak": BinarySensorDeviceClass.MOISTURE,
"realtime_current_in": SensorDeviceClass.CURRENT,
}

ICONS = {
Expand Down Expand Up @@ -131,6 +132,10 @@
"min_brightness": EntityCategory.CONFIG,
# Linptech Mesh Triple Wall Switch (no N)
"compatible_mode": EntityCategory.CONFIG,
# Linptech Sliding Window Driver WD1
"security_mode": EntityCategory.CONFIG,
"power_replenishment": EntityCategory.DIAGNOSTIC,
"realtime_current_in": EntityCategory.DIAGNOSTIC,
}

STATE_TIMEOUT = timedelta(minutes=10)
Expand Down
3 changes: 3 additions & 0 deletions custom_components/xiaomi_gateway3/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def new_entity(gateway: XGateway, device: XDevice, conv: Converter) -> XEntity:
# "msg_received": "msg",
# "msg_missed": "msg",
# "unresponsive": "times"
"power_replenishment": "mAh",
# Deprecated: please use UnitOfElectricCurrent.MILLIAMPERE.
"realtime_current_in": ELECTRIC_CURRENT_MILLIAMPERE,
}

# https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Expand Down

0 comments on commit 55627fc

Please sign in to comment.