8000 0.46 by balloob · Pull Request #7866 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.46 #7866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 107 commits into from
Jun 4, 2017
Merged

0.46 #7866

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
fc0c854
Version bump to 0.46.0.dev0
balloob May 18, 2017
0eb6540
Align with OpenALPR platform for naming conf variables (#7650)
fabaff May 18, 2017
0fd415d
Added support to Amcrest camera to feed using RTSP via ffmpeg (#7646)
tchellomello May 18, 2017
238921b
bump fedex version (#7653)
happyleavesaoc May 18, 2017
f65cc68
bump ups version (#7654)
happyleavesaoc May 18, 2017
e479324
update usps (#7655)
happyleavesaoc May 19, 2017
88ffe39
Final tweaks for Zwave panel (#7652)
turbokongen May 19, 2017
e91fe94
Update frontend
balloob May 19, 2017
7daa922
Add network_key as a config option (#7637)
robbiet480 May 19, 2017
5aa7256
Bugfix #7586 (#7661)
turbokongen May 19, 2017
d369d70
Fix tests (#7659)
balloob May 19, 2017
b5c5486
Change line endings to LN (#7660)
fabaff May 19, 2017
9e15311
Point pylutron to pypi (#7664)
thecynic May 20, 2017
f637a07
Update frontend
balloob May 20, 2017
adde9e6
Upgrade Openhome library (#7671)
May 20, 2017
81f0826
Ignore attribute changes in automation trigger from/to (#7651)
amelchio May 20, 2017
44edf3e
Switch pymodbus to pypi (#7677)
andrey-git May 20, 2017
ceff998
Merge branch 'master' into dev
fabaff May 20, 2017
24b7fd3
zoneminder: fix incorrect use of logging.exception. (#7675)
tobygray May 21, 2017
9270247
Zwave: Apply refresh_node workaround on 1st instance only (#7579)
andrey-git May 21, 2017
1710862
Guard against new and removed state change events (#7687)
balloob May 21, 2017
4a0d6e7
ZWave: Add reset service to meters (#7676)
turbokongen May 21, 2017
8c1181f
Remove defunct INSTALL_OPENZWAVE from Dockerfile (#7697)
emlove May 22, 2017
922303f
Fix telegram chats (#7689)
azogue May 22, 2017
b3cb057
Fix playback control of web streams (#7683)
cgtobi May 22, 2017
bb8de58
Sort entities in default groups by name (#7681)
amelchio May 22, 2017
99ea1e3
Continue tracking device over dhcp lease table if wireless adapter no…
LvivEchoes May 22, 2017
ca3f07c
device_tracker.ubus: Handle empty results (#7673)
tobygray May 22, 2017
d5642a5
Bump pyEight version (#7701)
mezz64 May 22, 2017
47355ee
Upgrade python-telegram-bot to 6.0.1 (#7704)
fabaff May 22, 2017
783abc7
Make 'sender' as requirement for the config (fixes #7698) (#7706)
fabaff May 22, 2017
17cbe0c
Allow fetching hass.io panel without auth (#7714)
balloob May 22, 2017
6872daa
update apcacccess used in apcupsd to 0.0.10, which fixes random file …
infamy May 23, 2017
2682996
Constrain requests to a version (#7725)
balloob May 23, 2017
c556b61
Asuswrt continuous ssh (#7728)
aronsky May 23, 2017
228fb8c
Ensure https base_url in telegram bot (#7726)
bzillins May 23, 2017
f3dabe2
Prevent the random template filter from caching its output. Fixes #56…
antsar May 23, 2017
be53cc7
Don't initialize mqtt components which have already been discovered (…
nordeep May 23, 2017
fce09f6
LIFX: disable color features for white-only bulbs (#7742)
amelchio May 23, 2017
7055fdd
Don't block startup more than 60 seconds while waiting for components…
antsar May 23, 2017
b5f20c9
Always return rgb color of bulbs (#7743)
May 23, 2017
e3307fb
Redesign monitored variables for hp_ilo sensor (#7534)
bjw-s May 23, 2017
54c45f8
Fix time_date sensor to update at predictable intervals (#7644)
stu-gott May 23, 2017
3638b21
Added new commands and functionality to the harmony remote component.…
everix1992 May 24, 2017
ef4ef2d
Template light (#7657)
cribbstechnologies May 24, 2017
e7d783c
Update links.html
balloob May 24, 2017
775d45a
Exclude filter for event types (#7627)
amigian74 May 24, 2017
0abde3a
Change setup script to use pip install instead of setup.py develop (#…
hoh May 24, 2017
0c7f8e9
Merge branch 'master' into dev
balloob May 25, 2017
3a843e1
Add icons to device tracker. (#7759)
antsar May 25, 2017
65c3201
Rename of the zwave hass.data constants (#7768)
emlove May 26, 2017
81aaeaa
Get rid of mock http component app (#7775)
balloob May 26, 2017
d0c9d6b
Remove usage of event_loop fixture (#7776)
balloob May 26, 2017
6899c7b
assertEquals is deprecated (#7777)
balloob May 26, 2017
9e9705d
Support for GE Zwave fan controller (#7767)
emlove May 26, 2017
f43db3c
Replace executor with async_add_job (#7658)
balloob May 26, 2017
910020b
Fix Telegram Bot send file to multiple targets, snapshots of HA camer…
azogue May 26, 2017
e68bd04
Fix more deprecation warnings (#7778)
balloob May 26, 2017
7fb5488
Powerview to async (#7682)
sander76 May 26, 2017
10367eb
Fix home/stay in concord232 (#7789)
CTLS May 28, 2017
1f3bb51
Add Marantz SSDP discovery / Detect error string in AppCommand.xml bo…
scarface-4711 May 29, 2017
010f098
Upgrade Sphinx to 1.6.2 (#7805)
fabaff May 29, 2017
8b7894f
Upgrade slacker to 0.9.50 (#7797)
fabaff May 29, 2017
ef51d85
Bump pyenvisalink to version 2.1 (#7803)
Cinntax May 29, 2017
c12b8f7
Upgrade pysnmp to 4.3.6 (#7806)
fabaff May 29, 2017
fc1bb58
Rachio (Sprinklers) (#7600)
Klikini May 29, 2017
eff619a
Rest notify data (#7757)
Teagan42 May 29, 2017
8fcc750
Added handling of an AssertionError from pxssh failed login (#7750)
aronsky May 29, 2017
ba44b7e
Upgrade sqlalchemy to 1.1.10 (#7807)
fabaff May 29, 2017
a7277db
Upgrade mypy to 0.511 (#7809)
fabaff May 29, 2017
5e5c0da
Allow configuring DSMR5 protocol. (#7535)
May 29, 2017
f7e0d13
Telegram send image: fix mimetype detection (#7802)
azogue May 29, 2017
81b2111
Bump aiohttp to 2.1.0 (#7825)
mezz64 May 30, 2017
2df6aab
Cleanup telegram / Add url to webhook (#7824)
pvizeli May 30, 2017
1c4e097
Upgrade pysnmp to 4.3.7 (#7828)
fabaff May 30, 2017
91806bf
Flux led fix (#7829)
Danielhiversen May 30, 2017
96b20b3
update snapcast media player (#7079)
happyleavesaoc May 30, 2017
0ccaf97
Update docstrings and log messages (#7709)
fabaff May 30, 2017
052cd3f
Upgrade PyMVGLive to 1.1.4 (#7832)
fabaff May 30, 2017
8ee32a8
Added persistent error message if cover.myq fails to load (#7700)
tchellomello May 30, 2017
9f5bfe2
Add initial benchmark framework (#7827)
balloob May 31, 2017
bb92ef5
Downgrade Docker to Python 3.5 to solve Segmentation Faults (#7799)
philhawthorne May 31, 2017
9762e16
Introduced support to Netgear Arlo Cameras (#7826)
tchellomello May 31, 2017
66d6f51
Allow 'base_url' (fixes #7784) (#7796)
fabaff May 31, 2017
e0712ba
Expose the node name on the zwave node entity (#7787)
emlove Jun 2, 2017
4bcbeef
Bumped pyhomematic version (#7861)
danielperna84 Jun 2, 2017
cf42303
Rename time trigger 'after' to 'at' (#7846)
emlove Jun 2, 2017
beb8c05
Use expected behvaior for above/below (#7857)
emlove Jun 2, 2017
2065426
log time delay of domain setup in info level (#7808)
8000 azogue Jun 2, 2017
1b5f6aa
Optimize history_stats efficiency and database usage (#7858)
bokub Jun 2, 2017
9480f41
dont use default for switch name, so that the object id is used (#7845)
abmantis Jun 2, 2017
e2cfdbf
Disallow ambiguous color descriptors in the light.turn_on schema (#7765)
amelchio Jun 2, 2017
d0021a6
Make monkey patch work in Python 3.6 (#7848)
balloob Jun 2, 2017
3a92bd7
fix permissions issue for Insteon Local #6558 (#7860)
craigjmidwinter Jun 2, 2017
78887c5
Start of migration framework, to allow moving of files in the config …
infamy Jun 2, 2017
cefacf9
Spotify aliases (#7702)
Teagan42 Jun 2, 2017
613da30
Query in InfluxDB sensor is now templatable (#7634)
titilambert Jun 2, 2017
1855f1a
fix for https://github.com/home-assistant/home-assistant/issues/7019 …
molobrakos Jun 2, 2017
12607ae
Check if media commands are actually applicable (#7595)
bjw-s Jun 2, 2017
2b70b18
Quickfix Bug #7384 (#7582)
DavidLP Jun 2, 2017
d472d81
Align switch group handling with light. (#7577)
Jun 2, 2017
4163bce
Update netdisco (#7865)
balloob Jun 2, 2017
f056cbc
Update frontend
balloob Jun 2, 2017
a33bcdf
Version bump to 0.46
balloob Jun 2, 2017
a79f1d4
Fix telegram_bot (#7877)
balloob Jun 3, 2017
4dc4a98
[light.lifx] Update aiolifx (#7882)
amelchio Jun 3, 2017
7ebf36b
Fix MQTT camera test (#7878)
balloob Jun 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ omit =
homeassistant/components/android_ip_webcam.py
homeassistant/components/*/android_ip_webcam.py

homeassistant/components/arlo.py
homeassistant/components/*/arlo.py

homeassistant/components/axis.py
homeassistant/components/*/axis.py

Expand Down Expand Up @@ -89,6 +92,9 @@ omit =
homeassistant/components/qwikswitch.py
homeassistant/components/*/qwikswitch.py

homeassistant/components/rachio.py
homeassistant/components/*/rachio.py

homeassistant/components/raspihats.py
homeassistant/components/*/raspihats.py

Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
#ENV INSTALL_TELLSTICK no
#ENV INSTALL_OPENALPR no
#ENV INSTALL_FFMPEG no
#ENV INSTALL_OPENZWAVE no
#ENV INSTALL_LIBCEC no
#ENV INSTALL_PHANTOMJS no
#ENV INSTALL_COAP_CLIENT no
Expand Down
10 changes: 4 additions & 6 deletions docs/source/_templates/links.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<ul>
<li><a href="https://community.home-assistant.io">📌 Community Forums</a></li>
<li><a href="https://github.com/home-assistant/home-assistant">🚀 GitHub</a></li>
<li><a href="https://home-assistant.io/">🏡 Homepage</a></li>
<li><a href="https://gitter.im/home-assistant/home-assistant">💬 Gitter</a></li>
<li><a href="https://pypi.python.org/pypi/homeassistant">💾 Download Releases</a></li>
<li><a href="https://home-assistant.io/">Homepage</a></li>
<li><a href="https://community.home-assistant.io">Community Forums</a></li>
<li><a href="https://github.com/home-assistant/home-assistant">GitHub</a></li>
<li><a href="https://gitter.im/home-assistant/home-assistant">Gitter</a></li>
</ul>
<hr>
12 changes: 11 additions & 1 deletion homeassistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

from typing import Optional, List

from homeassistant import monkey_patch
from homeassistant.const import (
__version__,
EVENT_HOMEASSISTANT_START,
REQUIRED_PYTHON_VER,
REQUIRED_PYTHON_VER_WIN,
RESTART_EXIT_CODE,
)
from homeassistant.util.async import run_callback_threadsafe


def attempt_use_uvloop():
Expand Down Expand Up @@ -310,6 +310,9 @@ def setup_and_run_hass(config_dir: str,
return None

if args.open_ui:
# Imported here to avoid importing asyncio before monkey patch
from homeassistant.util.async import run_callback_threadsafe

def open_browser(event):
"""Open the webinterface in a browser."""
if hass.config.api is not None:
Expand Down Expand Up @@ -371,6 +374,13 @@ def main() -> int:
"""Start Home Assistant."""
validate_python()

if os.environ.get('HASS_MONKEYPATCH_ASYNCIO') == '1':
if sys.version_info[:3] >= (3, 6):
monkey_patch.disable_c_asyncio()
monkey_patch.patch_weakref_tasks()
elif sys.version_info[:3] < (3, 5, 3):
monkey_patch.patch_weakref_tasks()

attempt_use_uvloop()

if sys.version_info[:3] < (3, 5, 3):
Expand Down
12 changes: 5 additions & 7 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def async_from_config_dict(config: Dict[str, Any],
conf_util.async_log_exception(ex, 'homeassistant', core_config, hass)
return None

yield from hass.loop.run_in_executor(
None, conf_util.process_ha_config_upgrade, hass)
yield from hass.async_add_job(conf_util.process_ha_config_upgrade, hass)

if enable_log:
async_enable_logging(hass, verbose, log_rotate_days)
Expand All @@ -95,7 +94,7 @@ def async_from_config_dict(config: Dict[str, Any],
'This may cause issues.')

if not loader.PREPARED:
yield from hass.loop.run_in_executor(None, loader.prepare, hass)
yield from hass.async_add_job(loader.prepare, hass)

# Merge packages
conf_util.merge_packages_config(
Expand Down Expand Up @@ -184,14 +183,13 @@ def async_from_config_file(config_path: str,
# Set config dir to directory holding config file
config_dir = os.path.abspath(os.path.dirname(config_path))
hass.config.config_dir = config_dir
yield from hass.loop.run_in_executor(
None, mount_local_lib_path, config_dir)
yield from hass.async_add_job(mount_local_lib_path, config_dir)

async_enable_logging(hass, verbose, log_rotate_days)

try:
config_dict = yield from hass.loop.run_in_executor(
None, conf_util.load_yaml_config_file, config_path)
config_dict = yield from hass.async_add_job(
conf_util.load_yaml_config_file, config_path)
except HomeAssistantError as err:
_LOGGER.error('Error loading %s: %s', config_path, err)
return None
Expand Down
16 changes: 6 additions & 10 deletions homeassistant/components/alarm_control_panel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def async_alarm_service_handler(service):
if update_tasks:
yield from asyncio.wait(upd 10000 ate_tasks, loop=hass.loop)

descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
descriptions = yield from hass.async_add_job(
load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))

for service in SERVICE_TO_METHOD:
Expand Down Expand Up @@ -158,8 +158,7 @@ def async_alarm_disarm(self, code=None):

This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_disarm, code)
return self.hass.async_add_job(self.alarm_disarm, code)

def alarm_arm_home(self, code=None):
"""Send arm home command."""
Expand All @@ -170,8 +169,7 @@ def async_alarm_arm_home(self, code=None):

This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_arm_home, code)
return self.hass.async_add_job(self.alarm_arm_home, code)

def alarm_arm_away(self, code=None):
"""Send arm away command."""
Expand All @@ -182,8 +180,7 @@ def async_alarm_arm_away(self, code=None):

This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_arm_away, code)
return self.hass.async_add_job(self.alarm_arm_away, code)

def alarm_trigger(self, code=None):
"""Send alarm trigger command."""
Expand All @@ -194,8 +191,7 @@ def async_alarm_trigger(self, code=None):

This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_trigger, code)
return self.hass.async_add_job(self.alarm_trigger, code)

@property
def state_attributes(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def alarm_disarm(self, code=None):

def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._alarm.arm('home')
self._alarm.arm('stay')

def alarm_arm_away(self, code=None):
"""Send arm away command."""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/alarm_control_panel/envisalink.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def alarm_keypress_handler(service):
device.async_alarm_keypress(keypress)

# Register Envisalink specific services
descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
descriptions = yield from hass.async_add_job(
load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))

hass.services.async_register(
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def async_handle_alert_service(service_call):
all_alerts[entity.entity_id] = entity

# Read descriptions
descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
descriptions = yield from hass.async_add_job(
load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))
descriptions = descriptions.get(DOMAIN, {})

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/apcupsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle

REQUIREMENTS = ['apcaccess==0.0.4']
REQUIREMENTS = ['apcaccess==0.0.10']

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get(self, request):
stop_obj = object()
to_write = asyncio.Queue(loop=hass.loop)

restrict = request.GET.get('restrict')
restrict = request.query.get('restrict')
if restrict:
restrict = restrict.split(',') + [EVENT_HOMEASSISTANT_STOP]

Expand Down
60 changes: 60 additions & 0 deletions homeassistant/components/arlo.py
10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""
This component provides basic support for Netgear Arlo IP cameras.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/arlo/
"""
import logging
import voluptuous as vol
from homeassistant.helpers import config_validation as cv

from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
import homeassistant.loader as loader

from requests.exceptions import HTTPError, ConnectTimeout

REQUIREMENTS = ['pyarlo==0.0.4']

_LOGGER = logging.getLogger(__name__)

CONF_ATTRIBUTION = 'Data provided by arlo.netgear.com'

DOMAIN = 'arlo'

DEFAULT_BRAND = 'Netgear Arlo'

NOTIFICATION_ID = 'arlo_notification'
NOTIFICATION_TITLE = 'Arlo Camera Setup'

CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
}),
}, extra=vol.ALLOW_EXTRA)


def setup(hass, config):
"""Set up an Arlo component."""
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)

persistent_notification = loader.get_component('persistent_notification')
try:
from pyarlo import PyArlo

arlo = PyArlo(username, password, preload=False)
if not arlo.is_connected:
return False
hass.data['arlo'] = arlo
except (ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Netgar Arlo: %s", str(ex))
persistent_notification.create(
hass, 'Error: {}<br />'
'You will need to restart hass after fixing.'
''.format(ex),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
return False
return True
4 changes: 2 additions & 2 deletions homeassistant/components/automation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def async_setup(hass, config):

yield from _async_process_config(hass, config, component)

descriptions = yield from hass.loop.run_in_executor(
None, conf_util.load_yaml_config_file, os.path.join(
descriptions = yield from hass.async_add_job(
conf_util.load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml')
)

Expand Down
14 changes: 8 additions & 6 deletions homeassistant/components/automation/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from homeassistant.const import MATCH_ALL, CONF_PLATFORM
from homeassistant.helpers.event import (
async_track_state_change, async_track_point_in_utc_time)
from homeassistant.helpers.deprecation import get_deprecated
import homeassistant.helpers.config_validation as cv

CONF_ENTITY_ID = 'entity_id'
Expand Down Expand Up @@ -40,10 +41,11 @@ def async_trigger(hass, config, action):
"""Listen for state changes based on configuration."""
entity_id = config.get(CONF_ENTITY_ID)
from_state = config.get(CONF_FROM, MATCH_ALL)
to_state = config.get(CONF_TO) or config.get(CONF_STATE) or MATCH_ALL
to_state = get_deprecated(config, CONF_TO, CONF_STATE, MATCH_ALL)
time_delta = config.get(CONF_FOR)
async_remove_state_for_cancel = None
async_remove_state_for_listener = None
match_all = (from_state == MATCH_ALL and to_state == MATCH_ALL)

@callback
def clear_listener():
Expand Down Expand Up @@ -75,13 +77,13 @@ def call_action():
}
})

if time_delta is None:
call_action()
# Ignore changes to state attributes if from/to is in use
if (not match_all and from_s is not None and to_s is not None and
from_s.last_changed == to_s.last_changed):
return

# If only state attributes changed, ignore this event
if (from_s is not None and to_s is not None and
from_s.last_changed == to_s.last_changed):
if time_delta is None:
call_action()
return

@callback
Expand Down
16 changes: 11 additions & 5 deletions homeassistant/components/automation/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import voluptuous as vol

from homeassistant.core import callback
from homeassistant.const import CONF_AFTER, CONF_PLATFORM
from homeassistant.const import CONF_AT, CONF_PLATFORM, CONF_AFTER
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change

Expand All @@ -22,20 +22,26 @@

TRIGGER_SCHEMA = vol.All(vol.Schema({
vol.Required(CONF_PLATFORM): 'time',
CONF_AT: cv.time,
CONF_AFTER: cv.time,
CONF_HOURS: vol.Any(vol.Coerce(int), vol.Coerce(str)),
CONF_MINUTES: vol.Any(vol.Coerce(int), vol.Coerce(str)),
CONF_SECONDS: vol.Any(vol.Coerce(int), vol.Coerce(str)),
}), cv.has_at_least_one_key(CONF_HOURS, CONF_MINUTES,
CONF_SECONDS, CONF_AFTER))
CONF_SECONDS, CONF_AT, CONF_AFTER))


@asyncio.coroutine
def async_trigger(hass, config, action):
"""Listen for state changes based on configuration."""
if CONF_AFTER in config:
after = config.get(CONF_AFTER)
hours, minutes, seconds = after.hour, after.minute, after.second
if CONF_AT in config:
at_time = config.get(CONF_AT)
hours, minutes, seconds = at_time.hour, at_time.minute, at_time.second
elif CONF_AFTER in config:
_LOGGER.warning("'after' is deprecated for the time trigger. Please "
"rename 'after' to 'at' in your configuration file.")
at_time = config.get(CONF_AFTER)
hours, minutes, seconds = at_time.hour, at_time.minute, at_time.second
else:
hours = config.get(CONF_HOURS)
minutes = config.get(CONF_MINUTES)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/binary_sensor/mystrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, add_devices):
@asyncio.coroutine
def get(self, request):
"""The GET request received from a myStrom button."""
res = yield from self._handle(request.app['hass'], request.GET)
res = yield from self._handle(request.app['hass'], request.query)
return res

@asyncio.coroutine
Expand Down
Loading
0