1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00

Use faster contains check in humidifier (#106433)

This commit is contained in:
J. Nick Koston 2023-12-26 21:46:13 -10:00 committed by GitHub
parent 7a2a99db2e
commit 9b864e8130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,7 @@ class HumidifierEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_AT
ATTR_MAX_HUMIDITY: self.max_humidity,
}
if self.supported_features & HumidifierEntityFeature.MODES:
if HumidifierEntityFeature.MODES in self.supported_features:
data[ATTR_AVAILABLE_MODES] = self.available_modes
return data
@ -214,7 +214,7 @@ class HumidifierEntity(ToggleEntity, cached_properties=CACHED_PROPERTIES_WITH_AT
if self.target_humidity is not None:
data[ATTR_HUMIDITY] = self.target_humidity
if self.supported_features & HumidifierEntityFeature.MODES:
if HumidifierEntityFeature.MODES in self.supported_features:
data[ATTR_MODE] = self.mode
return data