1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Use chained comparison in Teslemetry update platform (#161950)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Brett Adams
2026-02-12 05:07:04 +10:00
committed by GitHub
parent aa640020be
commit 6379014f13
2 changed files with 2 additions and 6 deletions

View File

@@ -3,11 +3,7 @@ rules:
action-setup: done
appropriate-polling: done
brands: done
common-modules:
status: todo
comment: |
Multiline lambdas should be wrapped in parentheses for readability (e.g. streaming_listener).
Use chained comparison: "if 1 < x < 100" instead of "if x > 1 and x < 100".
common-modules: done
config-flow: done
config-flow-test-coverage: done
dependency-transparency: done

View File

@@ -234,7 +234,7 @@ class TeslemetryStreamingUpdateEntity(
def _async_update_progress(self) -> None:
"""Update the progress of the update."""
if self._download_percentage > 1 and self._download_percentage < 100:
if 1 < self._download_percentage < 100:
self._attr_in_progress = True
self._attr_update_percentage = self._download_percentage
elif self._install_percentage > 10: