updated version number, added logging

This commit is contained in:
Patrick762 committed 2023-12-17 21:08:28 +01:00
1 parent 4710a8183f
commit 14f2219b94
3 files changed
+14 -6

No files matched your search

+9 -2
View File
@@ -143,9 +143,16 @@ class BluettiSensor(CoordinatorEntity, SensorEntity):
if self.coordinator.persistent_conn and not self.coordinator.client.is_connected:
return
if self.coordinator.data is None:
_LOGGER.warning(
"Data from coordinator is None. Skipping update for %s",
unique_id_loggable(self._attr_unique_id)
)
return
_LOGGER.debug("Updating state of %s", unique_id_loggable(self._attr_unique_id))
if not isinstance(self.coordinator.data, dict):
_LOGGER.debug(
_LOGGER.warning(
"Invalid data from coordinator (sensor.%s)", unique_id_loggable(self._attr_unique_id)
)
self._attr_available = False
@@ -153,7 +160,7 @@ class BluettiSensor(CoordinatorEntity, SensorEntity):
response_data = self.coordinator.data.get(self._response_key)
if response_data is None:
_LOGGER.debug("No data for available for (%s)", self._response_key)
_LOGGER.warning("No data for available for (%s)", self._response_key)
self._attr_available = False
return