Compare commits
3 Commits
0.10.7-con
...
0.10.9-con
| Author | SHA1 | Date | |
|---|---|---|---|
|
d8780b1790
|
|||
|
3d5010b4a1
|
|||
|
b471ab5edc
|
18
apps/abstraction/vendors/hottis_wifi_relay.py
vendored
18
apps/abstraction/vendors/hottis_wifi_relay.py
vendored
@@ -1,4 +1,4 @@
|
|||||||
"""Shelly vendor transformations."""
|
"""Hottis WiFi Relay vendor transformations."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -7,28 +7,28 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def transform_relay_to_vendor(payload: dict[str, Any]) -> str:
|
def transform_relay_to_vendor(payload: dict[str, Any]) -> str:
|
||||||
"""Transform abstract relay payload to Shelly format.
|
"""Transform abstract relay payload to Hottis WiFi Relay format.
|
||||||
|
|
||||||
Shelly expects plain text 'on' or 'off' (not JSON).
|
Hottis WiFi Relay expects plain text 'on' or 'off' (not JSON).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
- Abstract: {'power': 'on'}
|
- Abstract: {'power': 'on'}
|
||||||
- Shelly: 'on'
|
- Hottis WiFi Relay: 'ON'
|
||||||
"""
|
"""
|
||||||
power = payload.get("power", "off")
|
power = payload.get("power", "off").upper()
|
||||||
return power
|
return power
|
||||||
|
|
||||||
|
|
||||||
def transform_relay_to_abstract(payload: str) -> dict[str, Any]:
|
def transform_relay_to_abstract(payload: str) -> dict[str, Any]:
|
||||||
"""Transform Shelly relay payload to abstract format.
|
"""Transform Hottis WiFi Relay relay payload to abstract format.
|
||||||
|
|
||||||
Shelly sends plain text 'on' or 'off'.
|
Hottis WiFi Relay sends plain text 'on' or 'off'.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
- Shelly: 'on'
|
- Hottis WiFi Relay: 'ON'
|
||||||
- Abstract: {'power': 'on'}
|
- Abstract: {'power': 'on'}
|
||||||
"""
|
"""
|
||||||
return {"power": payload.strip()}
|
return {"power": payload.strip().lower()}
|
||||||
|
|
||||||
|
|
||||||
# Registry of handlers for this vendor
|
# Registry of handlers for this vendor
|
||||||
|
|||||||
@@ -957,4 +957,16 @@ devices:
|
|||||||
power: true
|
power: true
|
||||||
topics:
|
topics:
|
||||||
set: "IoT/WifiRelay1/State"
|
set: "IoT/WifiRelay1/State"
|
||||||
state: "IoT/WifiRelay1/State"
|
state: "IoT/WifiRelay1/State"
|
||||||
|
|
||||||
|
- device_id: herdlicht
|
||||||
|
name: Herdlicht
|
||||||
|
type: light
|
||||||
|
cap_version: "relay@1.0.0"
|
||||||
|
technology: zigbee2mqtt
|
||||||
|
features:
|
||||||
|
power: true
|
||||||
|
brightness: true
|
||||||
|
topics:
|
||||||
|
state: "zigbee2mqtt/herdlicht"
|
||||||
|
set: "zigbee2mqtt/herdlicht/set"
|
||||||
@@ -144,6 +144,10 @@ rooms:
|
|||||||
title: Küche Fensterbank
|
title: Küche Fensterbank
|
||||||
icon: 💡
|
icon: 💡
|
||||||
rank: 144
|
rank: 144
|
||||||
|
- device_id: herdlicht
|
||||||
|
title: Herdlicht
|
||||||
|
icon: 💡
|
||||||
|
rank: 145
|
||||||
- device_id: thermostat_kueche
|
- device_id: thermostat_kueche
|
||||||
title: Kueche
|
title: Kueche
|
||||||
icon: 🌡️
|
icon: 🌡️
|
||||||
|
|||||||
Reference in New Issue
Block a user