Improve lists in integrations [A] (#113006)
* Use list comprehension [A] * Use list comprehension [A] * Update homeassistant/components/aws/notify.py
This commit is contained in:
parent
bf40b33117
commit
690ba103ed
29 changed files with 267 additions and 297 deletions
|
@ -1196,11 +1196,12 @@ class AlexaThermostatController(AlexaCapability):
|
|||
if self.entity.domain == water_heater.DOMAIN:
|
||||
return None
|
||||
|
||||
supported_modes: list[str] = []
|
||||
hvac_modes = self.entity.attributes.get(climate.ATTR_HVAC_MODES) or []
|
||||
for mode in hvac_modes:
|
||||
if thermostat_mode := API_THERMOSTAT_MODES.get(mode):
|
||||
supported_modes.append(thermostat_mode)
|
||||
supported_modes: list[str] = [
|
||||
API_THERMOSTAT_MODES[mode]
|
||||
for mode in hvac_modes
|
||||
if mode in API_THERMOSTAT_MODES
|
||||
]
|
||||
|
||||
preset_modes = self.entity.attributes.get(climate.ATTR_PRESET_MODES)
|
||||
if preset_modes:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue