Vera Thermostat Support (#3247)
* vera thermostat & climate support * disable abstract * code review changes * fix * fix build * remove old method
This commit is contained in:
1 parent
8da85d7a91
commit
7528da455c
4 files changed
+148
-5
No files matched your search
@@ -20,7 +20,7 @@ from homeassistant.const import (
|
||||
EVENT_HOMEASSISTANT_STOP)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
REQUIREMENTS = ['pyvera==0.2.15']
|
||||
REQUIREMENTS = ['pyvera==0.2.16']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -42,10 +42,14 @@ CONFIG_SCHEMA = vol.Schema({
|
||||
DOMAIN: vol.Schema({
|
||||
vol.Required(CONF_CONTROLLER): cv.url,
|
||||
vol.Optional(CONF_EXCLUDE, default=[]): VERA_ID_LIST_SCHEMA,
|
||||
vol.Optional(CONF_LIGHTS, default=[]): VERA_ID_LIST_SCHEMA,
|
||||
vol.Optional(CONF_LIGHTS, default=[]): VERA_ID_LIST_SCHEMA
|
||||
}),
|
||||
}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
VERA_COMPONENTS = [
|
||||
'binary_sensor', 'sensor', 'light', 'switch', 'lock', 'climate'
|
||||
]
|
||||
|
||||
|
||||
# pylint: disable=unused-argument, too-many-function-args
|
||||
def setup(hass, base_config):
|
||||
@@ -83,7 +87,7 @@ def setup(hass, base_config):
|
||||
continue
|
||||
VERA_DEVICES[dev_type].append(device)
|
||||
|
||||
for component in 'binary_sensor', 'sensor', 'light', 'switch', 'lock':
|
||||
for component in VERA_COMPONENTS:
|
||||
discovery.load_platform(hass, component, DOMAIN, {}, base_config)
|
||||
|
||||
return True
|
||||
@@ -103,6 +107,8 @@ def map_vera_device(vera_device, remap):
|
||||
return 'switch'
|
||||
if isinstance(vera_device, veraApi.VeraLock):
|
||||
return 'lock'
|
||||
if isinstance(vera_device, veraApi.VeraThermostat):
|
||||
return 'climate'
|
||||
if isinstance(vera_device, veraApi.VeraSwitch):
|
||||
if vera_device.device_id in remap:
|
||||
return 'light'
|
||||
|
||||
Reference in new issue
Block a user