mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Enable Ruff SIM212 (#88181)
This commit is contained in:
parent
951269e88c
commit
793e51ac76
@ -106,7 +106,7 @@ _DESCRIPTIONS: dict[str, GoodweSensorEntityDescription] = {
|
|||||||
device_class=SensorDeviceClass.ENERGY,
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||||
value=lambda prev, val: prev if not val else val,
|
value=lambda prev, val: val if val else prev,
|
||||||
available=lambda entity: entity.coordinator.data is not None,
|
available=lambda entity: entity.coordinator.data is not None,
|
||||||
),
|
),
|
||||||
"C": GoodweSensorEntityDescription(
|
"C": GoodweSensorEntityDescription(
|
||||||
|
@ -251,6 +251,7 @@ select = [
|
|||||||
"SIM117", # Merge with-statements that use the same scope
|
"SIM117", # Merge with-statements that use the same scope
|
||||||
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
|
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
|
||||||
"SIM201", # Use {left} != {right} instead of not {left} == {right}
|
"SIM201", # Use {left} != {right} instead of not {left} == {right}
|
||||||
|
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
|
||||||
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
|
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
|
||||||
"SIM401", # Use get from dict with default instead of an if block
|
"SIM401", # Use get from dict with default instead of an if block
|
||||||
"T20", # flake8-print
|
"T20", # flake8-print
|
||||||
|
Loading…
x
Reference in New Issue
Block a user