From 6d83dafff2c51a1079b12d83a0c5c86fcb1f3fbb Mon Sep 17 00:00:00 2001 From: Jan De Luyck <5451787+jdeluyck@users.noreply.github.com> Date: Wed, 15 Jan 2020 16:21:55 +0100 Subject: [PATCH 01/12] Update emulated_roku to 0.1.9 (#30791) * Update emulated_roku to 0.1.9 * Update requirements_all --- homeassistant/components/emulated_roku/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/emulated_roku/manifest.json b/homeassistant/components/emulated_roku/manifest.json index 05cf72019d8..62d51d7d910 100644 --- a/homeassistant/components/emulated_roku/manifest.json +++ b/homeassistant/components/emulated_roku/manifest.json @@ -3,7 +3,7 @@ "name": "Emulated Roku", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/emulated_roku", - "requirements": ["emulated_roku==0.1.8"], + "requirements": ["emulated_roku==0.1.9"], "dependencies": [], "codeowners": [] } diff --git a/requirements_all.txt b/requirements_all.txt index c4fd9c6c5d6..8df1ea71c81 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -477,7 +477,7 @@ eliqonline==1.2.2 elkm1-lib==0.7.15 # homeassistant.components.emulated_roku -emulated_roku==0.1.8 +emulated_roku==0.1.9 # homeassistant.components.enocean enocean==0.50 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index cd30b43de99..51dcaf5226e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -171,7 +171,7 @@ eebrightbox==0.0.4 elgato==0.2.0 # homeassistant.components.emulated_roku -emulated_roku==0.1.8 +emulated_roku==0.1.9 # homeassistant.components.season ephem==3.7.7.0 From 368d04b2a10fff9aa1891fcb9d064b175032923e Mon Sep 17 00:00:00 2001 From: Josh Bendavid Date: Wed, 15 Jan 2020 19:48:30 +0100 Subject: [PATCH 02/12] update to aiopylgtv 0.2.7 (#30797) --- homeassistant/components/webostv/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/webostv/manifest.json b/homeassistant/components/webostv/manifest.json index ddd7be6f3da..ff254e35159 100644 --- a/homeassistant/components/webostv/manifest.json +++ b/homeassistant/components/webostv/manifest.json @@ -2,7 +2,7 @@ "domain": "webostv", "name": "LG webOS Smart TV", "documentation": "https://www.home-assistant.io/integrations/webostv", - "requirements": ["aiopylgtv==0.2.6"], + "requirements": ["aiopylgtv==0.2.7"], "dependencies": ["configurator"], "codeowners": ["@bendavid"] } diff --git a/requirements_all.txt b/requirements_all.txt index 8df1ea71c81..f59edf2b4b8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -190,7 +190,7 @@ aionotion==1.1.0 aiopvapi==1.6.14 # homeassistant.components.webostv -aiopylgtv==0.2.6 +aiopylgtv==0.2.7 # homeassistant.components.switcher_kis aioswitcher==2019.4.26 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 51dcaf5226e..d7f44aed82b 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -69,7 +69,7 @@ aiohue==1.10.1 aionotion==1.1.0 # homeassistant.components.webostv -aiopylgtv==0.2.6 +aiopylgtv==0.2.7 # homeassistant.components.switcher_kis aioswitcher==2019.4.26 From 8f852bd6567565d5b1e8a6c00853b2b3e46bc033 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Thu, 16 Jan 2020 10:48:47 +0100 Subject: [PATCH 03/12] Fix setup error of Mikrotik (#30810) --- homeassistant/components/mikrotik/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/mikrotik/__init__.py b/homeassistant/components/mikrotik/__init__.py index 9b533288d86..3892f9cb20d 100644 --- a/homeassistant/components/mikrotik/__init__.py +++ b/homeassistant/components/mikrotik/__init__.py @@ -167,7 +167,7 @@ class MikrotikClient: def get_hostname(self): """Return device host name.""" - data = self.command(MIKROTIK_SERVICES[IDENTITY]) + data = list(self.command(MIKROTIK_SERVICES[IDENTITY])) return data[0][NAME] if data else None def connected(self): From 881b35f9d6541a10fe788afb41600c814d99325e Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 Jan 2020 01:19:38 -0800 Subject: [PATCH 04/12] Handle no host info in ignored config entries (#30822) --- homeassistant/components/hue/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/hue/__init__.py b/homeassistant/components/hue/__init__.py index cbcb21db7d0..238ea06961d 100644 --- a/homeassistant/components/hue/__init__.py +++ b/homeassistant/components/hue/__init__.py @@ -69,7 +69,7 @@ async def async_setup(hass, config): bridges = conf[CONF_BRIDGES] configured_hosts = set( - entry.data["host"] for entry in hass.config_entries.async_entries(DOMAIN) + entry.data.get("host") for entry in hass.config_entries.async_entries(DOMAIN) ) for bridge_conf in bridges: From 5b51f740df99c7efed655f13788042836b643d4a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 16 Jan 2020 11:20:58 +0100 Subject: [PATCH 05/12] Fix mpd time issue (#30825) * Fix mpd time issue * Update homeassistant/components/mpd/media_player.py Co-Authored-By: Franck Nijhof --- homeassistant/components/mpd/media_player.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/mpd/media_player.py b/homeassistant/components/mpd/media_player.py index 6460becbb3e..4b6d63b4240 100644 --- a/homeassistant/components/mpd/media_player.py +++ b/homeassistant/components/mpd/media_player.py @@ -133,8 +133,8 @@ class MpdDevice(MediaPlayerDevice): self._status = self._client.status() self._currentsong = self._client.currentsong() - position = self._status["time"] - if self._media_position != position: + position = self._status.get("time") + if position is not None and self._media_position != position: self._media_position_updated_at = dt_util.utcnow() self._media_position = position From 6a8582750cf50870cf379046f84b54f694b31969 Mon Sep 17 00:00:00 2001 From: Josh Bendavid Date: Thu, 16 Jan 2020 12:30:55 +0100 Subject: [PATCH 06/12] Fix play_media in webostv (#30828) --- homeassistant/components/webostv/media_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/webostv/media_player.py b/homeassistant/components/webostv/media_player.py index 4652d6385c1..b7c8a416870 100644 --- a/homeassistant/components/webostv/media_player.py +++ b/homeassistant/components/webostv/media_player.py @@ -351,7 +351,7 @@ class LgWebOSMediaPlayerEntity(MediaPlayerDevice): partial_match_channel_id = None perfect_match_channel_id = None - for channel in self._client.get_channels(): + for channel in await self._client.get_channels(): if media_id == channel["channelNumber"]: perfect_match_channel_id = channel["channelId"] continue From 8fdf68c8d1af0e45d4dae9d25851bfe22761946b Mon Sep 17 00:00:00 2001 From: Quentame Date: Thu, 16 Jan 2020 18:27:43 +0100 Subject: [PATCH 07/12] Fix iCloud when no family members (issue #30829) (#30836) --- homeassistant/components/icloud/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/icloud/__init__.py b/homeassistant/components/icloud/__init__.py index e983f5fac22..fc4a5465bff 100644 --- a/homeassistant/components/icloud/__init__.py +++ b/homeassistant/components/icloud/__init__.py @@ -297,10 +297,11 @@ class IcloudAccount: self._owner_fullname = f"{user_info['firstName']} {user_info['lastName']}" self._family_members_fullname = {} - for prs_id, member in user_info["membersInfo"].items(): - self._family_members_fullname[ - prs_id - ] = f"{member['firstName']} {member['lastName']}" + if user_info.get("membersInfo") is not None: + for prs_id, member in user_info["membersInfo"].items(): + self._family_members_fullname[ + prs_id + ] = f"{member['firstName']} {member['lastName']}" self._devices = {} self.update_devices() From cc126761e129854ccf0009b192c2091c3a63a2bb Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 Jan 2020 11:28:35 -0800 Subject: [PATCH 08/12] Reinstate and deprecate filename option for hue config (#30846) --- homeassistant/components/hue/__init__.py | 6 +++++- tests/components/hue/test_init.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/hue/__init__.py b/homeassistant/components/hue/__init__.py index 238ea06961d..b294a811c61 100644 --- a/homeassistant/components/hue/__init__.py +++ b/homeassistant/components/hue/__init__.py @@ -44,7 +44,11 @@ CONFIG_SCHEMA = vol.Schema( DOMAIN: vol.Schema( { vol.Optional(CONF_BRIDGES): vol.All( - cv.ensure_list, [BRIDGE_CONFIG_SCHEMA] + cv.ensure_list, + [ + cv.deprecated("filename", invalidation_version="0.106.0"), + vol.All(BRIDGE_CONFIG_SCHEMA), + ], ) } ) diff --git a/tests/components/hue/test_init.py b/tests/components/hue/test_init.py index b48d66990e8..2e147fd097b 100644 --- a/tests/components/hue/test_init.py +++ b/tests/components/hue/test_init.py @@ -33,6 +33,7 @@ async def test_setup_defined_hosts_known_auth(hass): hue.CONF_HOST: "0.0.0.0", hue.CONF_ALLOW_HUE_GROUPS: False, hue.CONF_ALLOW_UNREACHABLE: True, + "filename": "bla", } } }, @@ -49,6 +50,7 @@ async def test_setup_defined_hosts_known_auth(hass): hue.CONF_HOST: "0.0.0.0", hue.CONF_ALLOW_HUE_GROUPS: False, hue.CONF_ALLOW_UNREACHABLE: True, + "filename": "bla", } } From 3f54533e72a65825b42469cd80be886932449fed Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 Jan 2020 11:33:54 -0800 Subject: [PATCH 09/12] Bumped version to 0.104.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 9095cdc5ced..77e681432db 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 104 -PATCH_VERSION = "0" +PATCH_VERSION = "1" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 0) From 006419b96c0f1bfb51a327f36b93ed8ec1c682c8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 Jan 2020 15:06:30 -0800 Subject: [PATCH 10/12] Whitelist Frenck for release --- azure-pipelines-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index ddf95d354c3..135057f2ae4 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -43,7 +43,7 @@ stages: release="$(Build.SourceBranchName)" created_by="$(curl -s https://api.github.com/repos/home-assistant/home-assistant/releases/tags/${release} | jq --raw-output '.author.login')" - if [[ "${created_by}" =~ ^(balloob|pvizeli|fabaff|robbiet480|bramkragten)$ ]]; then + if [[ "${created_by}" =~ ^(balloob|pvizeli|fabaff|robbiet480|bramkragten|frenck)$ ]]; then exit 0 fi From 0e1450838e47a89fbcc4a23846252726b1ee1b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per-=C3=98yvind=20Bruun?= Date: Thu, 16 Jan 2020 20:37:53 +0100 Subject: [PATCH 11/12] Fix for issue #29822 (#30849) --- homeassistant/components/msteams/notify.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/msteams/notify.py b/homeassistant/components/msteams/notify.py index c986f1d2363..eafac85c8c2 100644 --- a/homeassistant/components/msteams/notify.py +++ b/homeassistant/components/msteams/notify.py @@ -39,16 +39,18 @@ class MSTeamsNotificationService(BaseNotificationService): def __init__(self, webhook_url): """Initialize the service.""" self._webhook_url = webhook_url - self.teams_message = pymsteams.connectorcard(self._webhook_url) def send_message(self, message=None, **kwargs): """Send a message to the webhook.""" + + teams_message = pymsteams.connectorcard(self._webhook_url) + title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT) data = kwargs.get(ATTR_DATA) - self.teams_message.title(title) + teams_message.title(title) - self.teams_message.text(message) + teams_message.text(message) if data is not None: file_url = data.get(ATTR_FILE_URL) @@ -60,8 +62,8 @@ class MSTeamsNotificationService(BaseNotificationService): message_section = pymsteams.cardsection() message_section.addImage(file_url) - self.teams_message.addSection(message_section) + teams_message.addSection(message_section) try: - self.teams_message.send() + teams_message.send() except RuntimeError as err: _LOGGER.error("Could not send notification. Error: %s", err) From e2e01f50202e4aa1fa84bff40472a42df4db6479 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Thu, 16 Jan 2020 12:37:29 -0700 Subject: [PATCH 12/12] Fix sensor type creation with multiple Ambient weather stations (#30850) --- .../components/ambient_station/__init__.py | 16 ++++++++-------- .../components/ambient_station/binary_sensor.py | 10 ++++++++-- .../components/ambient_station/const.py | 1 + .../components/ambient_station/sensor.py | 10 ++++++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/ambient_station/__init__.py b/homeassistant/components/ambient_station/__init__.py index 58389dd1831..c61e15dfeb5 100644 --- a/homeassistant/components/ambient_station/__init__.py +++ b/homeassistant/components/ambient_station/__init__.py @@ -26,6 +26,7 @@ from homeassistant.helpers.event import async_call_later from .config_flow import configured_instances from .const import ( ATTR_LAST_DATA, + ATTR_MONITORED_CONDITIONS, CONF_APP_KEY, DATA_CLIENT, DOMAIN, @@ -341,7 +342,6 @@ class AmbientStation: self._watchdog_listener = None self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY self.client = client - self.monitored_conditions = [] self.stations = {} async def _attempt_connect(self): @@ -398,19 +398,19 @@ class AmbientStation: _LOGGER.debug("New station subscription: %s", data) - self.monitored_conditions = [ + # Only create entities based on the data coming through the socket. + # If the user is monitoring brightness (in W/m^2), make sure we also + # add a calculated sensor for the same data measured in lx: + monitored_conditions = [ k for k in station["lastData"] if k in SENSOR_TYPES ] - - # If the user is monitoring brightness (in W/m^2), - # make sure we also add a calculated sensor for the - # same data measured in lx: - if TYPE_SOLARRADIATION in self.monitored_conditions: - self.monitored_conditions.append(TYPE_SOLARRADIATION_LX) + if TYPE_SOLARRADIATION in monitored_conditions: + monitored_conditions.append(TYPE_SOLARRADIATION_LX) self.stations[station["macAddress"]] = { ATTR_LAST_DATA: station["lastData"], ATTR_LOCATION: station.get("info", {}).get("location"), + ATTR_MONITORED_CONDITIONS: monitored_conditions, ATTR_NAME: station.get("info", {}).get( "name", station["macAddress"] ), diff --git a/homeassistant/components/ambient_station/binary_sensor.py b/homeassistant/components/ambient_station/binary_sensor.py index 3f02eb9f1e8..1ed6dbd0db4 100644 --- a/homeassistant/components/ambient_station/binary_sensor.py +++ b/homeassistant/components/ambient_station/binary_sensor.py @@ -19,7 +19,13 @@ from . import ( TYPE_BATTOUT, AmbientWeatherEntity, ) -from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_BINARY_SENSOR +from .const import ( + ATTR_LAST_DATA, + ATTR_MONITORED_CONDITIONS, + DATA_CLIENT, + DOMAIN, + TYPE_BINARY_SENSOR, +) _LOGGER = logging.getLogger(__name__) @@ -35,7 +41,7 @@ async def async_setup_entry(hass, entry, async_add_entities): binary_sensor_list = [] for mac_address, station in ambient.stations.items(): - for condition in ambient.monitored_conditions: + for condition in station[ATTR_MONITORED_CONDITIONS]: name, _, kind, device_class = SENSOR_TYPES[condition] if kind == TYPE_BINARY_SENSOR: binary_sensor_list.append( diff --git a/homeassistant/components/ambient_station/const.py b/homeassistant/components/ambient_station/const.py index b2df34f2f28..21a6e514b30 100644 --- a/homeassistant/components/ambient_station/const.py +++ b/homeassistant/components/ambient_station/const.py @@ -2,6 +2,7 @@ DOMAIN = "ambient_station" ATTR_LAST_DATA = "last_data" +ATTR_MONITORED_CONDITIONS = "monitored_conditions" CONF_APP_KEY = "app_key" diff --git a/homeassistant/components/ambient_station/sensor.py b/homeassistant/components/ambient_station/sensor.py index 56425221e0d..0120799d6f2 100644 --- a/homeassistant/components/ambient_station/sensor.py +++ b/homeassistant/components/ambient_station/sensor.py @@ -9,7 +9,13 @@ from . import ( TYPE_SOLARRADIATION_LX, AmbientWeatherEntity, ) -from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_SENSOR +from .const import ( + ATTR_LAST_DATA, + ATTR_MONITORED_CONDITIONS, + DATA_CLIENT, + DOMAIN, + TYPE_SENSOR, +) _LOGGER = logging.getLogger(__name__) @@ -25,7 +31,7 @@ async def async_setup_entry(hass, entry, async_add_entities): sensor_list = [] for mac_address, station in ambient.stations.items(): - for condition in ambient.monitored_conditions: + for condition in station[ATTR_MONITORED_CONDITIONS]: name, unit, kind, device_class = SENSOR_TYPES[condition] if kind == TYPE_SENSOR: sensor_list.append(