mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
commit
6cfca09daf
@ -147,7 +147,7 @@ def _api_history_period(handler, path_match, data):
|
|||||||
|
|
||||||
end_time = start_time + one_day
|
end_time = start_time + one_day
|
||||||
|
|
||||||
print("Fetchign", start_time, end_time)
|
print("Fetching", start_time, end_time)
|
||||||
|
|
||||||
entity_id = data.get('filter_entity_id')
|
entity_id = data.get('filter_entity_id')
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
|
|||||||
self.serve_forever()
|
self.serve_forever()
|
||||||
|
|
||||||
def register_path(self, method, url, callback, require_auth=True):
|
def register_path(self, method, url, callback, require_auth=True):
|
||||||
""" Registers a path wit the server. """
|
""" Registers a path with the server. """
|
||||||
self.paths.append((method, url, callback, require_auth))
|
self.paths.append((method, url, callback, require_auth))
|
||||||
|
|
||||||
def log_message(self, fmt, *args):
|
def log_message(self, fmt, *args):
|
||||||
@ -487,7 +487,7 @@ class ServerSession:
|
|||||||
return self._expiry < date_util.utcnow()
|
return self._expiry < date_util.utcnow()
|
||||||
|
|
||||||
|
|
||||||
class SessionStore:
|
class SessionStore(object):
|
||||||
""" Responsible for storing and retrieving http sessions """
|
""" Responsible for storing and retrieving http sessions """
|
||||||
def __init__(self, enabled=True):
|
def __init__(self, enabled=True):
|
||||||
""" Set up the session store """
|
""" Set up the session store """
|
||||||
|
@ -28,7 +28,7 @@ def create_event_listener(schedule, event_listener_data):
|
|||||||
|
|
||||||
service = event_listener_data['service']
|
service = event_listener_data['service']
|
||||||
(hour, minute, second) = [int(x) for x in
|
(hour, minute, second) = [int(x) for x in
|
||||||
event_listener_data['time'].split(':')]
|
event_listener_data['time'].split(':', 3)]
|
||||||
|
|
||||||
return TimeEventListener(schedule, service, hour, minute, second)
|
return TimeEventListener(schedule, service, hour, minute, second)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.switch.arduino
|
homeassistant.components.switch.arduino
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Support for switching Arduino pins on and off. So fare only digital pins are
|
Support for switching Arduino pins on and off. So far only digital pins are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
Configuration:
|
Configuration:
|
||||||
|
@ -3,6 +3,7 @@ homeassistant.components.thermostat.nest
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Adds support for Nest thermostats.
|
Adds support for Nest thermostats.
|
||||||
"""
|
"""
|
||||||
|
import socket
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL,
|
from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL,
|
||||||
@ -35,12 +36,16 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
return
|
return
|
||||||
|
|
||||||
napi = nest.Nest(username, password)
|
napi = nest.Nest(username, password)
|
||||||
|
try:
|
||||||
add_devices([
|
add_devices([
|
||||||
NestThermostat(structure, device)
|
NestThermostat(structure, device)
|
||||||
for structure in napi.structures
|
for structure in napi.structures
|
||||||
for device in structure.devices
|
for device in structure.devices
|
||||||
])
|
])
|
||||||
|
except socket.error:
|
||||||
|
logger.error(
|
||||||
|
"Connection error logging into the nest web service"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class NestThermostat(ThermostatDevice):
|
class NestThermostat(ThermostatDevice):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user