mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-27 09:34:01 +08:00
last_update_success_time > last_update_success
This commit is contained in:
@@ -91,10 +91,12 @@ class HATextAISensor(CoordinatorEntity, SensorEntity):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
last_update = self.coordinator.data.get("last_update")
|
if self.coordinator.data and isinstance(self.coordinator.data, dict):
|
||||||
if isinstance(last_update, datetime):
|
last_update = self.coordinator.data.get("last_update")
|
||||||
return dt_util.as_local(last_update)
|
if isinstance(last_update, datetime):
|
||||||
return last_update
|
return dt_util.as_local(last_update)
|
||||||
|
return last_update
|
||||||
|
return None
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
_LOGGER.error("Error getting state: %s", err, exc_info=True)
|
_LOGGER.error("Error getting state: %s", err, exc_info=True)
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user