mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
add fan support for spider thermostats (#20897)
* add fan support for spider thermostats * resolved feedback on pull request
This commit is contained in:
parent
13421b326b
commit
ace1ae85dd
@ -14,7 +14,7 @@ from homeassistant.const import (
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.discovery import load_platform
|
||||
|
||||
REQUIREMENTS = ['spiderpy==1.2.0']
|
||||
REQUIREMENTS = ['spiderpy==1.3.1']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -9,12 +9,23 @@ import logging
|
||||
|
||||
from homeassistant.components.climate import (
|
||||
ATTR_TEMPERATURE, STATE_COOL, STATE_HEAT, STATE_IDLE,
|
||||
SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, ClimateDevice)
|
||||
SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE,
|
||||
SUPPORT_FAN_MODE, ClimateDevice)
|
||||
from homeassistant.components.spider import DOMAIN as SPIDER_DOMAIN
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
|
||||
DEPENDENCIES = ['spider']
|
||||
|
||||
FAN_LIST = [
|
||||
'Auto',
|
||||
'Low',
|
||||
'Medium',
|
||||
'High',
|
||||
'Boost 10',
|
||||
'Boost 20',
|
||||
'Boost 30'
|
||||
]
|
||||
|
||||
OPERATION_LIST = [
|
||||
STATE_HEAT,
|
||||
STATE_COOL,
|
||||
@ -55,7 +66,10 @@ class SpiderThermostat(ClimateDevice):
|
||||
supports = SUPPORT_TARGET_TEMPERATURE
|
||||
|
||||
if self.thermostat.has_operation_mode:
|
||||
supports = supports | SUPPORT_OPERATION_MODE
|
||||
supports |= SUPPORT_OPERATION_MODE
|
||||
|
||||
if self.thermostat.has_fan_mode:
|
||||
supports |= SUPPORT_FAN_MODE
|
||||
|
||||
return supports
|
||||
|
||||
@ -122,6 +136,20 @@ class SpiderThermostat(ClimateDevice):
|
||||
self.thermostat.set_operation_mode(
|
||||
HA_STATE_TO_SPIDER.get(operation_mode))
|
||||
|
||||
@property
|
||||
def current_fan_mode(self):
|
||||
"""Return the fan setting."""
|
||||
return self.thermostat.current_fan_speed
|
||||
|
||||
def set_fan_mode(self, fan_mode):
|
||||
"""Set fan mode."""
|
||||
self.thermostat.set_fan_speed(fan_mode)
|
||||
|
||||
@property
|
||||
def fan_list(self):
|
||||
"""List of available fan modes."""
|
||||
return FAN_LIST
|
||||
|
||||
def update(self):
|
||||
"""Get the latest data."""
|
||||
self.thermostat = self.api.get_thermostat(self.unique_id)
|
||||
|
@ -1573,7 +1573,7 @@ somecomfort==0.5.2
|
||||
speedtest-cli==2.0.2
|
||||
|
||||
# homeassistant.components.spider
|
||||
spiderpy==1.2.0
|
||||
spiderpy==1.3.1
|
||||
|
||||
# homeassistant.components.sensor.spotcrime
|
||||
spotcrime==1.0.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user