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.pypull/9060/head
parent
0f9ae8827c
commit
d153ee0b9f
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue