From 2f5c516c8b32ce4d93c7849d091390db2d0d1d53 Mon Sep 17 00:00:00 2001
From: MadOne <madone85@googlemail.com>
Date: Tue, 8 Oct 2024 19:03:14 +0000
Subject: [PATCH] Add Warmwasser - Konfiguration

---
 custom_components/weishaupt_modbus/sensor.py | 31 ++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/custom_components/weishaupt_modbus/sensor.py b/custom_components/weishaupt_modbus/sensor.py
index fcf7e03..5fb298d 100644
--- a/custom_components/weishaupt_modbus/sensor.py
+++ b/custom_components/weishaupt_modbus/sensor.py
@@ -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,
     )
@@ -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        #
     #####################