Improve entity type hints [z] (#77890)

This commit is contained in:
epenet 2022-09-06 14:01:09 +02:00 committed by GitHub
parent 23052dc7b5
commit 3a0eae3986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 42 additions and 37 deletions

View file

@ -116,7 +116,7 @@ class ZMSensorMonitors(SensorEntity):
"""Return True if Monitor is available."""
return self._is_available
def update(self):
def update(self) -> None:
"""Update the sensor."""
if not (state := self._monitor.function):
self._state = None
@ -143,7 +143,7 @@ class ZMSensorEvents(SensorEntity):
"""Return the name of the sensor."""
return f"{self._monitor.name} {self.time_period.title}"
def update(self):
def update(self) -> None:
"""Update the sensor."""
self._attr_native_value = self._monitor.get_events(
self.time_period, self._include_archived
@ -174,7 +174,7 @@ class ZMSensorRunState(SensorEntity):
"""Return True if ZoneMinder is available."""
return self._is_available
def update(self):
def update(self) -> None:
"""Update the sensor."""
self._state = self._client.get_active_state()
self._is_available = self._client.is_available