mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
bug fixes
This commit is contained in:
parent
80e829f53a
commit
067b5862c0
@ -30,7 +30,6 @@ from homeassistant.loader import get_component
|
|||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
|
|
||||||
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, CONF_API_KEY)
|
EVENT_PLATFORM_DISCOVERED, ATTR_SERVICE, ATTR_DISCOVERED, CONF_API_KEY)
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
@ -153,16 +152,4 @@ def setup(hass, config):
|
|||||||
|
|
||||||
setup_ecobee(hass, NETWORK.ecobee, config)
|
setup_ecobee(hass, NETWORK.ecobee, config)
|
||||||
|
|
||||||
def stop_ecobee(event):
|
|
||||||
""" Stop Ecobee. """
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
def start_ecobee(event):
|
|
||||||
""" Called when Home Assistant starts up. """
|
|
||||||
|
|
||||||
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_ecobee)
|
|
||||||
|
|
||||||
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_ecobee)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -26,7 +26,7 @@ ecobee:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.components.ecobee import NETWORK
|
from homeassistant.components import ecobee
|
||||||
from homeassistant.const import TEMP_FAHRENHEIT
|
from homeassistant.const import TEMP_FAHRENHEIT
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -48,9 +48,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
if discovery_info is None:
|
if discovery_info is None:
|
||||||
return
|
return
|
||||||
dev = list()
|
dev = list()
|
||||||
while NETWORK is None:
|
for name, data in ecobee.NETWORK.ecobee.sensors.items():
|
||||||
continue
|
|
||||||
for name, data in NETWORK.ecobee.sensors.items():
|
|
||||||
if 'temp' in data:
|
if 'temp' in data:
|
||||||
dev.append(EcobeeSensor(name, 'temperature'))
|
dev.append(EcobeeSensor(name, 'temperature'))
|
||||||
if 'humidity' in data:
|
if 'humidity' in data:
|
||||||
@ -86,8 +84,8 @@ class EcobeeSensor(Entity):
|
|||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
NETWORK.update()
|
ecobee.NETWORK.update()
|
||||||
data = NETWORK.ecobee.sensors[self.sensor_name]
|
data = ecobee.NETWORK.ecobee.sensors[self.sensor_name]
|
||||||
if self.type == 'temperature':
|
if self.type == 'temperature':
|
||||||
self._state = data['temp']
|
self._state = data['temp']
|
||||||
elif self.type == 'humidity':
|
elif self.type == 'humidity':
|
||||||
|
@ -28,7 +28,7 @@ ecobee:
|
|||||||
from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL,
|
from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL,
|
||||||
STATE_IDLE, STATE_HEAT)
|
STATE_IDLE, STATE_HEAT)
|
||||||
from homeassistant.const import (TEMP_FAHRENHEIT, STATE_ON, STATE_OFF)
|
from homeassistant.const import (TEMP_FAHRENHEIT, STATE_ON, STATE_OFF)
|
||||||
from homeassistant.components.ecobee import NETWORK
|
from homeassistant.components import ecobee
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
DEPENDENCIES = ['ecobee']
|
DEPENDENCIES = ['ecobee']
|
||||||
@ -43,7 +43,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
""" Setup Platform """
|
""" Setup Platform """
|
||||||
if discovery_info is None:
|
if discovery_info is None:
|
||||||
return
|
return
|
||||||
data = NETWORK
|
data = ecobee.NETWORK
|
||||||
hold_temp = discovery_info['hold_temp']
|
hold_temp = discovery_info['hold_temp']
|
||||||
_LOGGER.info("Loading ecobee thermostat component with hold_temp set to "
|
_LOGGER.info("Loading ecobee thermostat component with hold_temp set to "
|
||||||
+ str(hold_temp))
|
+ str(hold_temp))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user