mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Migrate to voluptuous (#3277)
This commit is contained in:
parent
1b77b2c3a3
commit
d20b4c17a2
@ -4,13 +4,24 @@ Support for Proliphix NT10e Thermostats.
|
|||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/climate.proliphix/
|
https://home-assistant.io/components/climate.proliphix/
|
||||||
"""
|
"""
|
||||||
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice)
|
STATE_COOL, STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST, CONF_PASSWORD, CONF_USERNAME, TEMP_FAHRENHEIT, ATTR_TEMPERATURE)
|
CONF_HOST, CONF_PASSWORD, CONF_USERNAME, TEMP_FAHRENHEIT, ATTR_TEMPERATURE)
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
REQUIREMENTS = ['proliphix==0.3.1']
|
REQUIREMENTS = ['proliphix==0.3.1']
|
||||||
|
|
||||||
|
ATTR_FAN = 'fan'
|
||||||
|
|
||||||
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
|
vol.Required(CONF_HOST): cv.string,
|
||||||
|
vol.Required(CONF_USERNAME): cv.string,
|
||||||
|
vol.Required(CONF_PASSWORD): cv.string,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
"""Setup the Proliphix thermostats."""
|
"""Setup the Proliphix thermostats."""
|
||||||
@ -22,9 +33,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
|
|
||||||
pdp = proliphix.PDP(host, username, password)
|
pdp = proliphix.PDP(host, username, password)
|
||||||
|
|
||||||
add_devices([
|
add_devices([ProliphixThermostat(pdp)])
|
||||||
ProliphixThermostat(pdp)
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=abstract-method
|
# pylint: disable=abstract-method
|
||||||
@ -56,7 +65,7 @@ class ProliphixThermostat(ClimateDevice):
|
|||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the device specific state attributes."""
|
"""Return the device specific state attributes."""
|
||||||
return {
|
return {
|
||||||
"fan": self._pdp.fan_state
|
ATTR_FAN: self._pdp.fan_state
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user