Improve entity type hints [c] (#77023)

This commit is contained in:
epenet 2022-08-19 13:02:46 +02:00 committed by GitHub
parent 80c1c11b1a
commit 0f792eb92e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 63 additions and 57 deletions

View file

@ -157,7 +157,7 @@ class CupsSensor(SensorEntity):
ATTR_PRINTER_URI_SUPPORTED: self._printer["printer-uri-supported"],
}
def update(self):
def update(self) -> None:
"""Get the latest data and updates the states."""
self.data.update()
self._printer = self.data.printers.get(self._name)
@ -234,7 +234,7 @@ class IPPSensor(SensorEntity):
return state_attributes
def update(self):
def update(self) -> None:
"""Fetch new state data for the sensor."""
self.data.update()
self._attributes = self.data.attributes.get(self._name)
@ -309,7 +309,7 @@ class MarkerSensor(SensorEntity):
ATTR_PRINTER_NAME: printer_name,
}
def update(self):
def update(self) -> None:
"""Update the state of the sensor."""
# Data fetching is done by CupsSensor/IPPSensor
self._attributes = self.data.attributes