mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
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
This commit is contained in:
parent
0f9ae8827c
commit
d153ee0b9f
@ -16,6 +16,11 @@ from homeassistant.helpers.typing import ConfigType
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_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 = {
|
VALUE_TO_STATE = {
|
||||||
0: SPEED_OFF,
|
0: SPEED_OFF,
|
||||||
63: SPEED_LOW,
|
63: SPEED_LOW,
|
||||||
@ -29,7 +34,7 @@ STATE_TO_VALUE = {}
|
|||||||
for key in VALUE_TO_STATE:
|
for key in VALUE_TO_STATE:
|
||||||
STATE_TO_VALUE[VALUE_TO_STATE[key]] = key
|
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
|
# pylint: disable=unused-argument
|
||||||
@ -93,6 +98,11 @@ class ISYFanDevice(isy.ISYDevice, FanEntity):
|
|||||||
else:
|
else:
|
||||||
self.speed = self.state
|
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):
|
class ISYFanProgram(ISYFanDevice):
|
||||||
"""Representation of an ISY994 fan program."""
|
"""Representation of an ISY994 fan program."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user