Issue #779 - error in ValveOpenPercent sensor at startup (#814)

* issue #779 - error in ValveOpenPercent sensor at startup

* fix log

---------

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
Jean-Marc Collin
2025-01-12 11:26:32 +01:00
committed by GitHub
parent 3fd9ffe93d
commit 1d675f22c7

View File

@@ -303,6 +303,10 @@ class ValveOpenPercentSensor(VersatileThermostatBaseEntity, SensorEntity):
"""Called when my climate have change"""
# _LOGGER.debug("%s - climate state change", self._attr_unique_id)
if not self.my_climate or not hasattr(self.my_climate, "valve_open_percent"):
_LOGGER.warning("%s - my_climate not found or no valve_open_percent property found. This could be normal at startup. Ignore the underlying device change.", self)
return
old_state = self._attr_native_value
self._attr_native_value = self.my_climate.valve_open_percent
if old_state != self._attr_native_value: