mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Added additional checks which hides functions which are not supported by Nest (#3751)
* Added additional checks which hides functions which are not support (like fans / humidity / cooling) * Fixed pylint and flake8 errors (not test file available) * Fixed pydocstyle error * Refactored Code and Comments as described in pull-request * Added additional comment and requesting retest * Upgraded to python-nest 2.11 which contains previously hidden functions
This commit is contained in:
parent
941fccd3fc
commit
8c9d1d9af1
@ -40,8 +40,19 @@ class NestThermostat(ClimateDevice):
|
|||||||
self.structure = structure
|
self.structure = structure
|
||||||
self.device = device
|
self.device = device
|
||||||
self._fan_list = [STATE_ON, STATE_AUTO]
|
self._fan_list = [STATE_ON, STATE_AUTO]
|
||||||
self._operation_list = [STATE_HEAT, STATE_COOL, STATE_AUTO,
|
|
||||||
STATE_OFF]
|
# Not all nest devices support cooling and heating remove unused
|
||||||
|
self._operation_list = [STATE_OFF]
|
||||||
|
|
||||||
|
# Add supported nest thermostat features
|
||||||
|
if self.device.can_heat:
|
||||||
|
self._operation_list.append(STATE_HEAT)
|
||||||
|
|
||||||
|
if self.device.can_cool:
|
||||||
|
self._operation_list.append(STATE_COOL)
|
||||||
|
|
||||||
|
if self.device.can_heat and self.device.can_cool:
|
||||||
|
self._operation_list.append(STATE_AUTO)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -64,11 +75,15 @@ class NestThermostat(ClimateDevice):
|
|||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the device specific state attributes."""
|
"""Return the device specific state attributes."""
|
||||||
# Move these to Thermostat Device and make them global
|
if self.device.has_humidifier or self.device.has_dehumidifier:
|
||||||
return {
|
# Move these to Thermostat Device and make them global
|
||||||
"humidity": self.device.humidity,
|
return {
|
||||||
"target_humidity": self.device.target_humidity,
|
"humidity": self.device.humidity,
|
||||||
}
|
"target_humidity": self.device.target_humidity,
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
# No way to control humidity not show setting
|
||||||
|
return {}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
@ -164,7 +179,12 @@ class NestThermostat(ClimateDevice):
|
|||||||
@property
|
@property
|
||||||
def current_fan_mode(self):
|
def current_fan_mode(self):
|
||||||
"""Return whether the fan is on."""
|
"""Return whether the fan is on."""
|
||||||
return STATE_ON if self.device.fan else STATE_AUTO
|
if self.device.has_fan:
|
||||||
|
# Return whether the fan is on
|
||||||
|
return STATE_ON if self.device.fan else STATE_AUTO
|
||||||
|
else:
|
||||||
|
# No Fan available so disable slider
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fan_list(self):
|
def fan_list(self):
|
||||||
|
@ -14,7 +14,7 @@ from homeassistant.const import (CONF_PASSWORD, CONF_USERNAME, CONF_STRUCTURE)
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
REQUIREMENTS = ['python-nest==2.10.0']
|
REQUIREMENTS = ['python-nest==2.11.0']
|
||||||
|
|
||||||
DOMAIN = 'nest'
|
DOMAIN = 'nest'
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ python-mpd2==0.5.5
|
|||||||
python-mystrom==0.3.6
|
python-mystrom==0.3.6
|
||||||
|
|
||||||
# homeassistant.components.nest
|
# homeassistant.components.nest
|
||||||
python-nest==2.10.0
|
python-nest==2.11.0
|
||||||
|
|
||||||
# homeassistant.components.device_tracker.nmap_tracker
|
# homeassistant.components.device_tracker.nmap_tracker
|
||||||
python-nmap==0.6.1
|
python-nmap==0.6.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user