From d153ee0b9f1253f5fa0c47b422c407212bac56f0 Mon Sep 17 00:00:00 2001
From: boojew <boojew@gmail.com>
Date: Sat, 19 Aug 2017 15:17:47 -0400
Subject: [PATCH] Add speeds to fan dropdown in ISY fan component (#9004)

* Add speeds to fan dropdown in ISY fan component

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py
---
 homeassistant/components/fan/isy994.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/homeassistant/components/fan/isy994.py b/homeassistant/components/fan/isy994.py
index 8b9236fdb32..90cd161fa20 100644
--- a/homeassistant/components/fan/isy994.py
+++ b/homeassistant/components/fan/isy994.py
@@ -16,6 +16,11 @@ from homeassistant.helpers.typing import ConfigType
 
 _LOGGER = logging.getLogger(__name__)
 
+# Define term used for medium speed. This must be set as the fan component uses
+# 'medium' which the ISY does not understand
+ISY_SPEED_MEDIUM = 'med'
+
+
 VALUE_TO_STATE = {
     0: SPEED_OFF,
     63: SPEED_LOW,
@@ -29,7 +34,7 @@ STATE_TO_VALUE = {}
 for key in VALUE_TO_STATE:
     STATE_TO_VALUE[VALUE_TO_STATE[key]] = key
 
-STATES = [SPEED_OFF, SPEED_LOW, 'med', SPEED_HIGH]
+STATES = [SPEED_OFF, SPEED_LOW, ISY_SPEED_MEDIUM, SPEED_HIGH]
 
 
 # pylint: disable=unused-argument
@@ -93,6 +98,11 @@ class ISYFanDevice(isy.ISYDevice, FanEntity):
         else:
             self.speed = self.state
 
+    @property
+    def speed_list(self) -> list:
+        """Get the list of available speeds."""
+        return [SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH]
+
 
 class ISYFanProgram(ISYFanDevice):
     """Representation of an ISY994 fan program."""
-- 
GitLab