tasmoto and kommode
All checks were successful
ci/woodpecker/tag/build/5 Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/build/6 Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/5 Pipeline was successful
ci/woodpecker/tag/ingress Pipeline was successful
All checks were successful
ci/woodpecker/tag/build/5 Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/build/6 Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/5 Pipeline was successful
ci/woodpecker/tag/ingress Pipeline was successful
This commit is contained in:
@@ -351,6 +351,36 @@ def _transform_relay_shelly_to_abstract(payload: str) -> dict[str, Any]:
|
||||
"""
|
||||
return {"power": payload.strip()}
|
||||
|
||||
# ============================================================================
|
||||
# HANDLER FUNCTIONS: relay - tasmota technology
|
||||
# ============================================================================
|
||||
|
||||
def _transform_relay_tasmota_to_vendor(payload: dict[str, Any]) -> str:
|
||||
"""Transform abstract relay payload to Tasmota format.
|
||||
|
||||
Tasmota expects plain text 'on' or 'off' (not JSON).
|
||||
- power: 'on'/'off' -> 'on'/'off' (plain string)
|
||||
|
||||
Example:
|
||||
- Abstract: {'power': 'on'}
|
||||
- Tasmota: 'on'
|
||||
"""
|
||||
power = payload.get("power", "off")
|
||||
return power
|
||||
|
||||
|
||||
def _transform_relay_tasmota_to_abstract(payload: str) -> dict[str, Any]:
|
||||
"""Transform Tasmota relay payload to abstract format.
|
||||
|
||||
Tasmota sends plain text 'on' or 'off' (not JSON).
|
||||
- 'on'/'off' -> power: 'on'/'off'
|
||||
|
||||
Example:
|
||||
- Tasmota: 'ON'
|
||||
- Abstract: {'power': 'on'}
|
||||
"""
|
||||
return {"power": payload.strip().lower()}
|
||||
|
||||
# ============================================================================
|
||||
# HANDLER FUNCTIONS: relay - hottis_pv_modbus technology
|
||||
# ============================================================================
|
||||
@@ -581,6 +611,8 @@ TRANSFORM_HANDLERS: dict[tuple[str, str, str], TransformHandler] = {
|
||||
("relay", "shelly", "to_abstract"): _transform_relay_shelly_to_abstract,
|
||||
("relay", "hottis_pv_modbus", "to_vendor"): _transform_relay_hottis_pv_modbus_to_vendor,
|
||||
("relay", "hottis_pv_modbus", "to_abstract"): _transform_relay_hottis_pv_modbus_to_abstract,
|
||||
("relay", "tasmota", "to_vendor"): _transform_relay_tasmota_to_vendor,
|
||||
("relay", "tasmota", "to_abstract"): _transform_relay_tasmota_to_abstract,
|
||||
|
||||
# Three-Phase Powermeter transformations
|
||||
("three_phase_powermeter", "hottis_pv_modbus", "to_vendor"): _transform_three_phase_powermeter_hottis_pv_modbus_to_vendor,
|
||||
|
||||
Reference in New Issue
Block a user