mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use faster contains check in water_heater (#106438)
This commit is contained in:
parent
59a01da0ed
commit
99734a76aa
@ -241,7 +241,7 @@ class WaterHeaterEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
||||
),
|
||||
}
|
||||
|
||||
if self.supported_features & WaterHeaterEntityFeature.OPERATION_MODE:
|
||||
if WaterHeaterEntityFeature.OPERATION_MODE in self.supported_features:
|
||||
data[ATTR_OPERATION_LIST] = self.operation_list
|
||||
|
||||
return data
|
||||
@ -277,10 +277,12 @@ class WaterHeaterEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
||||
),
|
||||
}
|
||||
|
||||
if self.supported_features & WaterHeaterEntityFeature.OPERATION_MODE:
|
||||
supported_features = self.supported_features
|
||||
|
||||
if WaterHeaterEntityFeature.OPERATION_MODE in supported_features:
|
||||
data[ATTR_OPERATION_MODE] = self.current_operation
|
||||
|
||||
if self.supported_features & WaterHeaterEntityFeature.AWAY_MODE:
|
||||
if WaterHeaterEntityFeature.AWAY_MODE in supported_features:
|
||||
is_away = self.is_away_mode_on
|
||||
data[ATTR_AWAY_MODE] = STATE_ON if is_away else STATE_OFF
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user