Skip to content

Commit

Permalink
Fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Terasa committed Jan 29, 2024
1 parent 81c1f8b commit 7be3f9d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/foxess_api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ def native_value(self) -> datetime | StateType:
try:
return self.entity_description.state(self.coordinator.data)
except KeyError:
LOGGER.warning("Could not get state for %s. If this error persists, check API for changes. ",
"(Current version is %s)", self.entity_description.key, API_VERSION)
LOGGER.warning("Could not get state for %s. If this error persists, "
"check API for changes. (Current version is %s)",
self.entity_description.key,
API_VERSION)
return None
except TypeError:
LOGGER.warning("Type error for %s. If this error persists, check API for changes. ",
"(Current version is %s)", self.entity_description.key, API_VERSION)
LOGGER.warning("Type error for %s. If this error persists, "
"check API for changes. (Current version is %s)",
self.entity_description.key,
API_VERSION)
return None
except Exception as e:
LOGGER.error(e)

0 comments on commit 7be3f9d

Please sign in to comment.