Fix capability_attributes when supported_features is None (#30993)

* Fix capability_attributes when supported_features is None (water_heater)

* Fix capability_attributes when supported_features is None (media_player)
This commit is contained in:
Jeff Irion authored and Franck Nijhof committed 2020-01-21 12:14:28 +01:00
1 parent 6889816704
commit 392cf57750
2 files changed
+2 -2

No files matched your search

@@ -785,7 +785,7 @@ class MediaPlayerDevice(Entity):
@property
def capability_attributes(self):
"""Return capabilitiy attributes."""
supported_features = self.supported_features
supported_features = self.supported_features or 0
data = {}
if supported_features & SUPPORT_SELECT_SOURCE:
@@ -146,7 +146,7 @@ class WaterHeaterDevice(Entity):
@property
def capability_attributes(self):
"""Return capabilitiy attributes."""
supported_features = self.supported_features
supported_features = self.supported_features or 0
data = {
ATTR_MIN_TEMP: show_temp(