Skip to content

Commit

Permalink
Add Warmwasser - Konfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
MadOne committed Oct 8, 2024
1 parent ee260ef commit 2f5c516
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions custom_components/weishaupt_modbus/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async def async_setup_entry(
HP_Leistungsanforderung(host, port),
Hp_Vorlauftemperatur(host, port),
Hp_Ruecklauftemperatur(host, port),
WW_Konfiguration(host, port),
],
update_before_add=True,
)
Expand Down Expand Up @@ -501,6 +502,36 @@ def device_info(self) -> DeviceInfo:
"identifiers": {(DOMAIN, "Warmwasser")},
}


class WW_Konfiguration(SensorEntity):
"""Representation of a Sensor."""

_attr_name = "Konfiguration"
_attr_unique_id = DOMAIN + _attr_name
_attr_should_poll = True

def __init__(self, host, port) -> None:
"""Init."""
self._host = host
self._port = port

async def async_update(self) -> None:
"""Fetch new state data for the sensor.
This is the only method that should fetch new data for Home Assistant.
"""

whp = wp.heat_pump(self._host, self._port)
whp.connect()
self._attr_native_value = whp.WW_Konfiguration

@property
def device_info(self) -> DeviceInfo:
"""Information about this entity/device."""
return {
"identifiers": {(DOMAIN, "Warmwasser")},
}

#####################
# Heatpump #
#####################
Expand Down

0 comments on commit 2f5c516

Please sign in to comment.