Skip to content
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

Hotfix 0.21.1 #2281

Merged
merged 9 commits into from
Jun 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified docs/screenshots.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions homeassistant/components/alexa.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def post(self, request):
card = config.get(CONF_CARD)
action = config.get(CONF_ACTION)

if action is not None:
action.run(response.variables)

# pylint: disable=unsubscriptable-object
if speech is not None:
response.add_speech(SpeechType[speech['type']], speech['text'])
Expand All @@ -104,9 +107,6 @@ def post(self, request):
response.add_card(CardType[card['type']], card['title'],
card['content'])

if action is not None:
action.run(response.variables)

return self.json(response)


Expand Down
12 changes: 6 additions & 6 deletions homeassistant/components/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ def camera_image(self):
def mjpeg_stream(self, response):
"""Generate an HTTP MJPEG stream from camera images."""
import eventlet
response.content_type = ('multipart/x-mixed-replace; '
'boundary=--jpegboundary')

def stream():
"""Stream images as mjpeg stream."""
Expand All @@ -112,9 +110,11 @@ def stream():
except GeneratorExit:
pass

response.response = stream()

return response
return response(
stream(),
content_type=('multipart/x-mixed-replace; '
'boundary=--jpegboundary')
)

@property
def state(self):
Expand Down Expand Up @@ -196,4 +196,4 @@ class CameraMjpegStream(CameraView):

def handle(self, camera):
"""Serve camera image."""
return camera.mjpeg_stream(self.Response())
return camera.mjpeg_stream(self.Response)
8 changes: 5 additions & 3 deletions homeassistant/components/camera/mjpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ def process_response(response):
def mjpeg_stream(self, response):
"""Generate an HTTP MJPEG stream from the camera."""
stream = self.camera_stream()
response.mimetype = stream.headers[CONTENT_TYPE_HEADER]
response.response = stream.iter_content(chunk_size=1024)
return response
return response(
stream.iter_content(chunk_size=1024),
mimetype=stream.headers[CONTENT_TYPE_HEADER],
direct_passthrough=True
)

@property
def name(self):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/frontend/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""DO NOT MODIFY. Auto-generated by build_frontend script."""
CORE = "d0b415dac66c8056d81380b258af5767"
UI = "b0ea2672fff86b1ab86dd86135d4b43a"
CORE = "88b6966e3a74256ecca41ed8ad005c34"
UI = "c6fc10efa7789ab041a1bb0b6849eb6b"
10 changes: 5 additions & 5 deletions homeassistant/components/frontend/www_static/core.js

Large diffs are not rendered by default.

Binary file modified homeassistant/components/frontend/www_static/core.js.gz
Binary file not shown.
234 changes: 6 additions & 228 deletions homeassistant/components/frontend/www_static/frontend.html

Large diffs are not rendered by default.

Binary file modified homeassistant/components/frontend/www_static/frontend.html.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


/* eslint-disable quotes, comma-spacing */
var PrecacheConfig = [["/","69818e2c5b6f4ca764c46ac78d2fea04"],["/devEvent","69818e2c5b6f4ca764c46ac78d2fea04"],["/devInfo","69818e2c5b6f4ca764c46ac78d2fea04"],["/devService","69818e2c5b6f4ca764c46ac78d2fea04"],["/devState","69818e2c5b6f4ca764c46ac78d2fea04"],["/devTemplate","69818e2c5b6f4ca764c46ac78d2fea04"],["/history","69818e2c5b6f4ca764c46ac78d2fea04"],["/logbook","69818e2c5b6f4ca764c46ac78d2fea04"],["/map","69818e2c5b6f4ca764c46ac78d2fea04"],["/states","69818e2c5b6f4ca764c46ac78d2fea04"],["/static/core-d0b415dac66c8056d81380b258af5767.js","dfafa8e9e34f53e8c36dd8b3f7299b2a"],["/static/frontend-b0ea2672fff86b1ab86dd86135d4b43a.html","69818e2c5b6f4ca764c46ac78d2fea04"],["/static/mdi-9ee3d4466a65bef35c2c8974e91b37c0.html","9a6846935116cd29279c91e0ee0a26d0"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]];
var PrecacheConfig = [["/","5113b71ee83242d02b525f3331a5d8cc"],["/devEvent","5113b71ee83242d02b525f3331a5d8cc"],["/devInfo","5113b71ee83242d02b525f3331a5d8cc"],["/devService","5113b71ee83242d02b525f3331a5d8cc"],["/devState","5113b71ee83242d02b525f3331a5d8cc"],["/devTemplate","5113b71ee83242d02b525f3331a5d8cc"],["/history","5113b71ee83242d02b525f3331a5d8cc"],["/logbook","5113b71ee83242d02b525f3331a5d8cc"],["/map","5113b71ee83242d02b525f3331a5d8cc"],["/states","5113b71ee83242d02b525f3331a5d8cc"],["/static/core-88b6966e3a74256ecca41ed8ad005c34.js","dec9792a59ab21903b7dda457784db98"],["/static/frontend-c6fc10efa7789ab041a1bb0b6849eb6b.html","5113b71ee83242d02b525f3331a5d8cc"],["/static/mdi-9ee3d4466a65bef35c2c8974e91b37c0.html","9a6846935116cd29279c91e0ee0a26d0"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]];
/* eslint-enable quotes, comma-spacing */
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';

Expand Down
Binary file not shown.
7 changes: 6 additions & 1 deletion homeassistant/components/lirc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def run(self):
"""Main loop of LIRC interface thread."""
import lirc
while not self.stopped.isSet():
code = lirc.nextcode() # list; empty if no buttons pressed
try:
code = lirc.nextcode() # list; empty if no buttons pressed
except lirc.NextCodeError:
_LOGGER.warning('Encountered error reading '
'next code from LIRC')
code = None
# interpret result from python-lirc
if code:
code = code[0]
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/sensor/gtfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_next_departure(sched, start_station_id, end_station_id):
AND time(origin_stop_time.departure_time) > time(:now_str)
AND start_station.stop_id = :origin_station_id
AND end_station.stop_id = :end_station_id
AND origin_stop_time.stop_sequence < destination_stop_time.stop_sequence
ORDER BY origin_stop_time.departure_time LIMIT 1;
""".format(day_name=day_name))
result = sched.engine.execute(sql_query, now_str=now_str,
Expand Down
23 changes: 11 additions & 12 deletions homeassistant/components/zwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ def setup(hass, config):
config_path=config[DOMAIN].get('config_path',
default_zwave_config_path),)

# Setup autoheal
if autoheal:
_LOGGER.info("ZWave network autoheal is enabled.")
track_time_change(hass, lambda: heal_network(None),
hour=0, minute=0, second=0)

options.set_console_output(use_debug)
options.lock()

Expand Down Expand Up @@ -291,24 +285,24 @@ def scene_activated(node, scene_id):
dispatcher.connect(
scene_activated, ZWaveNetwork.SIGNAL_SCENE_EVENT, weak=False)

def add_node(event):
def add_node(service):
"""Switch into inclusion mode."""
NETWORK.controller.begin_command_add_device()

def remove_node(event):
def remove_node(service):
"""Switch into exclusion mode."""
NETWORK.controller.begin_command_remove_device()

def heal_network(event):
def heal_network(service):
"""Heal the network."""
_LOGGER.info("ZWave heal running.")
NETWORK.heal()

def soft_reset(event):
def soft_reset(service):
"""Soft reset the controller."""
NETWORK.controller.soft_reset()

def test_network(event):
def test_network(service):
"""Test the network by sending commands to all the nodes."""
NETWORK.test()

Expand All @@ -324,7 +318,7 @@ def start_zwave(event):
# Wait up to NETWORK_READY_WAIT_SECS seconds for the zwave network
# to be ready.
for i in range(NETWORK_READY_WAIT_SECS):
_LOGGER.info(
_LOGGER.debug(
"network state: %d %s", NETWORK.state, NETWORK.state_str)
if NETWORK.state >= NETWORK.STATE_AWAKED:
_LOGGER.info("zwave ready after %d seconds", i)
Expand Down Expand Up @@ -355,6 +349,11 @@ def start_zwave(event):
hass.services.register(DOMAIN, SERVICE_SOFT_RESET, soft_reset)
hass.services.register(DOMAIN, SERVICE_TEST_NETWORK, test_network)

# Setup autoheal
if autoheal:
_LOGGER.info("ZWave network autoheal is enabled.")
track_time_change(hass, heal_network, hour=0, minute=0, second=0)

hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_zwave)

return True
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8
"""Constants used by Home Assistant components."""

__version__ = "0.21.0"
__version__ = "0.21.1"
REQUIRED_PYTHON_VER = (3, 4)

PLATFORM_FORMAT = '{}.{}'
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def config_per_platform(config, domain):
platform_config = [platform_config]

for item in platform_config:
platform = None if item is None else item.get(CONF_PLATFORM)
try:
platform = item.get(CONF_PLATFORM)
except AttributeError:
platform = None

yield platform, item


Expand Down
1 change: 1 addition & 0 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pip>=7.0.0
jinja2>=2.8
voluptuous==0.8.9
webcolors==1.5
eventlet==0.19.0

# homeassistant.components.isy994
PyISY==1.0.6
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'jinja2>=2.8',
'voluptuous==0.8.9',
'webcolors==1.5',
'eventlet==0.19.0',
]

setup(
Expand Down
17 changes: 17 additions & 0 deletions tests/helpers/test_init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test component helpers."""
# pylint: disable=protected-access,too-many-public-methods
from collections import OrderedDict
import unittest

from homeassistant import helpers
Expand Down Expand Up @@ -30,3 +31,19 @@ def test_extract_domain_configs(self):

self.assertEqual(set(['zone', 'zone Hallo', 'zone 100']),
set(helpers.extract_domain_configs(config, 'zone')))

def test_config_per_platform(self):
"""Test config per platform method."""
config = OrderedDict([
('zone', {'platform': 'hello'}),
('zoner', None),
('zone Hallo', [1, {'platform': 'hello 2'}]),
('zone 100', None),
])

assert [
('hello', config['zone']),
(None, 1),
('hello 2', config['zone Hallo'][1]),
(None, None)
] == list(helpers.config_per_platform(config, 'zone'))