Add ruff rules PIE790, PIE794, PIE807, PIE810 (#113617)
This commit is contained in:
parent
cbe2a5883b
commit
0b9c9aff62
25 changed files with 29 additions and 47 deletions
|
@ -774,13 +774,7 @@ class BrSensor(SensorEntity):
|
|||
self._measured = data.get(MEASURED)
|
||||
sensor_type = self.entity_description.key
|
||||
|
||||
if (
|
||||
sensor_type.endswith("_1d")
|
||||
or sensor_type.endswith("_2d")
|
||||
or sensor_type.endswith("_3d")
|
||||
or sensor_type.endswith("_4d")
|
||||
or sensor_type.endswith("_5d")
|
||||
):
|
||||
if sensor_type.endswith(("_1d", "_2d", "_3d", "_4d", "_5d")):
|
||||
# update forecasting sensors:
|
||||
fcday = 0
|
||||
if sensor_type.endswith("_2d"):
|
||||
|
@ -793,7 +787,7 @@ class BrSensor(SensorEntity):
|
|||
fcday = 4
|
||||
|
||||
# update weather symbol & status text
|
||||
if sensor_type.startswith(SYMBOL) or sensor_type.startswith(CONDITION):
|
||||
if sensor_type.startswith((SYMBOL, CONDITION)):
|
||||
try:
|
||||
condition = data.get(FORECAST)[fcday].get(CONDITION)
|
||||
except IndexError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue