@@ -42,6 +42,7 @@ async def async_setup_entry(
42
42
HK_Raum_Soll_Normal (host , port ),
43
43
HK_Raum_Soll_Absenk (host , port ),
44
44
HK_Heizkennlinie (host , port ),
45
+ HK_SommerWinterUmschaltung (host , port ),
45
46
],
46
47
update_before_add = True ,
47
48
)
@@ -398,3 +399,46 @@ def device_info(self) -> DeviceInfo:
398
399
return {
399
400
"identifiers" : {(DOMAIN , "Heizkreis" )},
400
401
}
402
+
403
+
404
+ class HK_SommerWinterUmschaltung (NumberEntity ):
405
+ """Representation of a WEM Portal number."""
406
+
407
+ _attr_name = "HK Sommer Winter Umschaltung"
408
+ _attr_unique_id = DOMAIN + _attr_name
409
+ _attr_native_value = 0
410
+ _attr_should_poll = True
411
+ _attr_native_min_value = 3
412
+ _attr_native_max_value = 30
413
+ _attr_native_step = 0.5
414
+ _attr_native_unit_of_measurement = UnitOfTemperature .CELSIUS
415
+
416
+ def __init__ (self , host , port ) -> None :
417
+ """Init."""
418
+ self ._host = host
419
+ self ._port = port
420
+ # whp = wp.heat_pump(host, port)
421
+ # whp.connect()
422
+ # self._attr_native_value = whp.WW_Absenk
423
+ # self.async_write_ha_state()
424
+
425
+ async def async_set_native_value (self , value : float ) -> None :
426
+ """Update the current value."""
427
+ whp = wp .heat_pump (self ._host , self ._port )
428
+ whp .connect ()
429
+ whp .HK_SommerWinterUmschaltung = value
430
+ self ._attr_native_value = whp .HK_SommerWinterUmschaltung
431
+ self .async_write_ha_state ()
432
+
433
+ async def async_update (self ) -> None :
434
+ """Update Entity Only used by the generic entity update service."""
435
+ whp = wp .heat_pump (self ._host , self ._port )
436
+ whp .connect ()
437
+ self ._attr_native_value = whp .HK_SommerWinterUmschaltung
438
+
439
+ @property
440
+ def device_info (self ) -> DeviceInfo :
441
+ """Information about this entity/device."""
442
+ return {
443
+ "identifiers" : {(DOMAIN , "Heizkreis" )},
444
+ }
0 commit comments