Implement capability attributes (#30545)

* Implement capability attributes

* Fix HeOS update order

* Fix test
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-01-08 21:22:56 +01:00
1 parent 4cd83e71dd
commit ed6aef2fd7
6 files changed
+58 -14

No files matched your search

+5 -1
View File
@@ -47,7 +47,6 @@ ATTR_DIRECTION = "direction"
PROP_TO_ATTR = {
"speed": ATTR_SPEED,
"speed_list": ATTR_SPEED_LIST,
"oscillating": ATTR_OSCILLATING,
"current_direction": ATTR_DIRECTION,
}
@@ -178,6 +177,11 @@ class FanEntity(ToggleEntity):
"""Return the current direction of the fan."""
return None
@property
def capability_attributes(self):
"""Return capabilitiy attributes."""
return {ATTR_SPEED_LIST: self.speed_list}
@property
def state_attributes(self) -> dict:
"""Return optional state attributes."""