From 7c041f079760fe5d4fd7d0a6489d0179e8b15ebd Mon Sep 17 00:00:00 2001 From: Open Home Automation Date: Sat, 13 Aug 2016 23:16:06 +0200 Subject: [PATCH 1/8] Bugfix: removed conf_platform (#2811) * Bugfix: removed conf_platform * Remove unused import * Fix for wrong update --- homeassistant/components/sensor/serial_pm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/serial_pm.py b/homeassistant/components/sensor/serial_pm.py index f625affce2c..a86fea74cea 100644 --- a/homeassistant/components/sensor/serial_pm.py +++ b/homeassistant/components/sensor/serial_pm.py @@ -7,7 +7,7 @@ https://home-assistant.io/components/sensor.serial_pm/ import logging import voluptuous as vol -from homeassistant.const import CONF_NAME, CONF_PLATFORM +from homeassistant.const import CONF_NAME from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -21,7 +21,6 @@ CONF_SERIAL_DEVICE = "serial_device" CONF_BRAND = "brand" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ - vol.Required(CONF_PLATFORM): 'serial_pm', vol.Optional(CONF_NAME, default=""): cv.string, vol.Required(CONF_SERIAL_DEVICE): cv.string, vol.Required(CONF_BRAND): cv.string, From 12ce3deffc688d3569b13e82f0f1392276c7b0a4 Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Sun, 14 Aug 2016 10:20:28 +0200 Subject: [PATCH 2/8] Check for existence of system mode on Honeywell thermostats (#2815) * Check for existence of system mode on Honeywell thermostats * Return None instead of undefined * Use getattr instead of if/else --- homeassistant/components/thermostat/honeywell.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/thermostat/honeywell.py b/homeassistant/components/thermostat/honeywell.py index b31dfea0b4b..6d9a4b790eb 100644 --- a/homeassistant/components/thermostat/honeywell.py +++ b/homeassistant/components/thermostat/honeywell.py @@ -139,7 +139,7 @@ class RoundThermostat(ThermostatDevice): @property def operation(self: ThermostatDevice) -> str: """Get the current operation of the system.""" - return self.device.system_mode + return getattr(self.device, 'system_mode', None) @property def is_away_mode_on(self): @@ -148,7 +148,8 @@ class RoundThermostat(ThermostatDevice): def set_hvac_mode(self: ThermostatDevice, hvac_mode: str) -> None: """Set the HVAC mode for the thermostat.""" - self.device.system_mode = hvac_mode + if hasattr(self.device, 'system_mode'): + self.device.system_mode = hvac_mode def turn_away_mode_on(self): """Turn away on. @@ -231,7 +232,7 @@ class HoneywellUSThermostat(ThermostatDevice): @property def operation(self: ThermostatDevice) -> str: """Return current operation ie. heat, cool, idle.""" - return self._device.system_mode + return getattr(self._device, 'system_mode', None) def set_temperature(self, temperature): """Set target temperature.""" @@ -261,4 +262,5 @@ class HoneywellUSThermostat(ThermostatDevice): def set_hvac_mode(self: ThermostatDevice, hvac_mode: str) -> None: """Set the system mode (Cool, Heat, etc).""" - self._device.system_mode = hvac_mode + if hasattr(self._device, 'system_mode'): + self._device.system_mode = hvac_mode From c16a29b930522bafd7b02cba71a41f42f9f1a77f Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Sun, 14 Aug 2016 10:19:54 +0200 Subject: [PATCH 3/8] Fix unknown unit of measurement for hvac and thermostat component (#2816) * Fix unknown unit of measurement for hvac and thermostat component * Simplify --- homeassistant/components/hvac/zwave.py | 5 +++-- homeassistant/components/thermostat/zwave.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/hvac/zwave.py b/homeassistant/components/hvac/zwave.py index 2747cc8eb32..f8cb3fa5c9e 100755 --- a/homeassistant/components/hvac/zwave.py +++ b/homeassistant/components/hvac/zwave.py @@ -120,8 +120,9 @@ class ZWaveHvac(ZWaveDeviceEntity, HvacDevice): # Current Temp for value in self._node.get_values( class_id=COMMAND_CLASS_SENSOR_MULTILEVEL).values(): - self._current_temperature = int(value.data) - self._unit = value.units + if value.label == 'Temperature': + self._current_temperature = int(value.data) + self._unit = value.units # Fan Mode for value in self._node.get_values( class_id=COMMAND_CLASS_THERMOSTAT_FAN_MODE).values(): diff --git a/homeassistant/components/thermostat/zwave.py b/homeassistant/components/thermostat/zwave.py index 80766d47100..bd5e5d04b58 100644 --- a/homeassistant/components/thermostat/zwave.py +++ b/homeassistant/components/thermostat/zwave.py @@ -91,8 +91,9 @@ class ZWaveThermostat(zwave.ZWaveDeviceEntity, ThermostatDevice): # current Temp for _, value in self._node.get_values_for_command_class( COMMAND_CLASS_SENSOR_MULTILEVEL).items(): - self._current_temperature = int(value.data) - self._unit = value.units + if value.label == 'Temperature': + self._current_temperature = int(value.data) + self._unit = value.units # operation state for _, value in self._node.get_values( From 32051c042ce66f63e84575dad8f4d4df8fe2619b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 14 Aug 2016 01:21:57 -0700 Subject: [PATCH 4/8] Version bump to 0.26.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 7161f319b30..16930328693 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.26.0" +__version__ = "0.26.1" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}' From 8a8551132fccebbb5a46d144f9c6926f1ccfe324 Mon Sep 17 00:00:00 2001 From: Greg Dowling Date: Sun, 14 Aug 2016 19:42:43 +0100 Subject: [PATCH 5/8] Bump to pywemo 0.4.5 - fixes bug with requests 2.11.0 (#2818) --- homeassistant/components/wemo.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/wemo.py b/homeassistant/components/wemo.py index 1a32d4c361e..00a7017fa0f 100644 --- a/homeassistant/components/wemo.py +++ b/homeassistant/components/wemo.py @@ -10,7 +10,7 @@ from homeassistant.components.discovery import SERVICE_WEMO from homeassistant.helpers import discovery from homeassistant.const import EVENT_HOMEASSISTANT_STOP -REQUIREMENTS = ['pywemo==0.4.3'] +REQUIREMENTS = ['pywemo==0.4.5'] DOMAIN = 'wemo' diff --git a/requirements_all.txt b/requirements_all.txt index e2be50c8f4d..be9977d6b8b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -374,7 +374,7 @@ pyuserinput==0.1.9 pyvera==0.2.15 # homeassistant.components.wemo -pywemo==0.4.3 +pywemo==0.4.5 # homeassistant.components.thermostat.radiotherm radiotherm==1.2 From c4b714a10d137f35273db930880be288c8449dd0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 14 Aug 2016 21:22:28 -0700 Subject: [PATCH 6/8] Version bump to 0.26.2 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 16930328693..2dfedf9dfe6 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.26.1" +__version__ = "0.26.2" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}' From 2b10a1ac205d61c31cbf60f6d119becc11699cc0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 18 Aug 2016 22:45:42 -0700 Subject: [PATCH 7/8] Fix media player art (#2879) --- homeassistant/components/media_player/__init__.py | 1 + tests/components/media_player/test_demo.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index 7efbbe01653..38e476c5d8c 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -667,6 +667,7 @@ class MediaPlayerDevice(Entity): class MediaPlayerImageView(HomeAssistantView): """Media player view to serve an image.""" + requires_auth = False url = "/api/media_player_proxy/" name = "api:media_player:image" diff --git a/tests/components/media_player/test_demo.py b/tests/components/media_player/test_demo.py index f2b9ce4b032..03a97a44b30 100644 --- a/tests/components/media_player/test_demo.py +++ b/tests/components/media_player/test_demo.py @@ -2,6 +2,7 @@ import unittest from unittest.mock import patch from homeassistant import bootstrap +from homeassistant.const import HTTP_HEADER_HA_AUTH import homeassistant.components.media_player as mp import homeassistant.components.http as http @@ -13,6 +14,8 @@ from tests.common import get_test_home_assistant, get_test_instance_port SERVER_PORT = get_test_instance_port() HTTP_BASE_URL = 'http://127.0.0.1:{}'.format(SERVER_PORT) +API_PASSWORD = "test1234" +HA_HEADERS = {HTTP_HEADER_HA_AUTH: API_PASSWORD} hass = None @@ -26,7 +29,8 @@ def setUpModule(): # pylint: disable=invalid-name hass = get_test_home_assistant() bootstrap.setup_component(hass, http.DOMAIN, { http.DOMAIN: { - http.CONF_SERVER_PORT: SERVER_PORT + http.CONF_SERVER_PORT: SERVER_PORT, + http.CONF_API_PASSWORD: API_PASSWORD, }, }) From a548eb6c7f38ae19390a10309902f5df33c0bfc4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 18 Aug 2016 22:46:34 -0700 Subject: [PATCH 8/8] Version bump to 0.26.3 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 2dfedf9dfe6..74ff104fcda 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.26.2" +__version__ = "0.26.3" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}'