Use f-strings in integrations starting with "H" - "L" (#32265)
* Use f-strings in integrations starting with "H" * Use f-strings in integrations starting with "I" * Use f-strings in integrations starting with "J" * Use f-strings in integrations starting with "K" * Use f-strings in integrations starting with "L" * Fix lint error * Use join instead of f-string in homekit_controller * Use local variables with f-strings * Fix lint error * Escape the characters in f-string * Sort imports with isort in homeworks light * Fix pylint error * Fix broken tests * Fix broken tests v2
This commit is contained in:
1 parent
7714160f4c
commit
157f972d72
77 files changed
+158
-246
No files matched your search
@@ -50,10 +50,8 @@ class LogiSensor(Entity):
|
||||
self._sensor_type = sensor_type
|
||||
self._camera = camera
|
||||
self._id = f"{self._camera.mac_address}-{self._sensor_type}"
|
||||
self._icon = "mdi:{}".format(SENSOR_TYPES.get(self._sensor_type)[2])
|
||||
self._name = "{0} {1}".format(
|
||||
self._camera.name, SENSOR_TYPES.get(self._sensor_type)[0]
|
||||
)
|
||||
self._icon = f"mdi:{SENSOR_TYPES.get(self._sensor_type)[2]}"
|
||||
self._name = f"{self._camera.name} {SENSOR_TYPES.get(self._sensor_type)[0]}"
|
||||
self._activity = {}
|
||||
self._state = None
|
||||
self._tz = time_zone
|
||||
@@ -127,8 +125,8 @@ class LogiSensor(Entity):
|
||||
last_activity = await self._camera.get_last_activity(force_refresh=True)
|
||||
if last_activity is not None:
|
||||
last_activity_time = as_local(last_activity.end_time_utc)
|
||||
self._state = "{0:0>2}:{1:0>2}".format(
|
||||
last_activity_time.hour, last_activity_time.minute
|
||||
self._state = (
|
||||
f"{last_activity_time.hour:0>2}:{last_activity_time.minute:0>2}"
|
||||
)
|
||||
else:
|
||||
state = getattr(self._camera, self._sensor_type, None)
|
||||
|
||||
Reference in new issue
Block a user