From 28b3edf6b2a414ebc68b1944586dfd56c8eef26a Mon Sep 17 00:00:00 2001 From: cheng2wei <99464193+cheng2wei@users.noreply.github.com> Date: Tue, 8 Mar 2022 20:01:00 -0800 Subject: [PATCH 01/12] Fix discord embed class initialization (#67831) --- homeassistant/components/discord/notify.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/discord/notify.py b/homeassistant/components/discord/notify.py index 41137e1a32cfe..2e13b68225c2f 100644 --- a/homeassistant/components/discord/notify.py +++ b/homeassistant/components/discord/notify.py @@ -20,9 +20,13 @@ ATTR_EMBED = "embed" ATTR_EMBED_AUTHOR = "author" +ATTR_EMBED_COLOR = "color" +ATTR_EMBED_DESCRIPTION = "description" ATTR_EMBED_FIELDS = "fields" ATTR_EMBED_FOOTER = "footer" +ATTR_EMBED_TITLE = "title" ATTR_EMBED_THUMBNAIL = "thumbnail" +ATTR_EMBED_URL = "url" ATTR_IMAGES = "images" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_TOKEN): cv.string}) @@ -64,10 +68,16 @@ async def async_send_message(self, message, **kwargs): embeds: list[nextcord.Embed] = [] if ATTR_EMBED in data: embedding = data[ATTR_EMBED] + title = embedding.get(ATTR_EMBED_TITLE) or nextcord.Embed.Empty + description = embedding.get(ATTR_EMBED_DESCRIPTION) or nextcord.Embed.Empty + color = embedding.get(ATTR_EMBED_COLOR) or nextcord.Embed.Empty + url = embedding.get(ATTR_EMBED_URL) or nextcord.Embed.Empty fields = embedding.get(ATTR_EMBED_FIELDS) or [] if embedding: - embed = nextcord.Embed(**embedding) + embed = nextcord.Embed( + title=title, description=description, color=color, url=url + ) for field in fields: embed.add_field(**field) if ATTR_EMBED_FOOTER in embedding: From f5b6d93706dcc621be38471cafe181a76c467149 Mon Sep 17 00:00:00 2001 From: Richard de Boer Date: Tue, 8 Mar 2022 16:56:15 +0100 Subject: [PATCH 02/12] Support playing local "file" media on Kodi (#67832) Co-authored-by: Paulus Schoutsen --- homeassistant/components/kodi/media_player.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/kodi/media_player.py b/homeassistant/components/kodi/media_player.py index 53798a7ccd9f6..e1dae879bf8e4 100644 --- a/homeassistant/components/kodi/media_player.py +++ b/homeassistant/components/kodi/media_player.py @@ -717,6 +717,8 @@ async def async_play_media( await self._kodi.play_channel(int(media_id)) elif media_type_lower == MEDIA_TYPE_PLAYLIST: await self._kodi.play_playlist(int(media_id)) + elif media_type_lower == "file": + await self._kodi.play_file(media_id) elif media_type_lower == "directory": await self._kodi.play_directory(media_id) elif media_type_lower in [ From c22af2c82a002f1f26ba15a14107ed87789609ff Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 8 Mar 2022 03:44:39 -0500 Subject: [PATCH 03/12] Bump zwave-js-server-python to 0.35.2 (#67839) --- homeassistant/components/zwave_js/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/zwave_js/manifest.json b/homeassistant/components/zwave_js/manifest.json index 6a892b2791d8a..8d1a9091bc03b 100644 --- a/homeassistant/components/zwave_js/manifest.json +++ b/homeassistant/components/zwave_js/manifest.json @@ -3,7 +3,7 @@ "name": "Z-Wave JS", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zwave_js", - "requirements": ["zwave-js-server-python==0.35.1"], + "requirements": ["zwave-js-server-python==0.35.2"], "codeowners": ["@home-assistant/z-wave"], "dependencies": ["usb", "http", "websocket_api"], "iot_class": "local_push", diff --git a/requirements_all.txt b/requirements_all.txt index e74e091557216..1a22f6f89d023 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2566,7 +2566,7 @@ zigpy==0.43.0 zm-py==0.5.2 # homeassistant.components.zwave_js -zwave-js-server-python==0.35.1 +zwave-js-server-python==0.35.2 # homeassistant.components.zwave_me zwave_me_ws==0.2.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 2031915fc1d6a..d802fe91bc043 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1588,7 +1588,7 @@ zigpy-znp==0.7.0 zigpy==0.43.0 # homeassistant.components.zwave_js -zwave-js-server-python==0.35.1 +zwave-js-server-python==0.35.2 # homeassistant.components.zwave_me zwave_me_ws==0.2.1 From cad397d6a7d7221c18fbeb2695683f99e98e453d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 8 Mar 2022 10:16:41 +0100 Subject: [PATCH 04/12] Add missing callback decorator to sun (#67840) --- homeassistant/components/sun/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index fd819e5ad33e5..4789490ef0db0 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -101,6 +101,7 @@ def __init__(self, hass): self.rising = self.phase = None self._next_change = None + @callback def update_location(_event): location, elevation = get_astral_location(self.hass) if location == self.location: From 07e70c81b0a41a1c856522fdf51ccb462d77f4a3 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Tue, 8 Mar 2022 19:56:57 +0200 Subject: [PATCH 05/12] Fix shelly duo scene restore (#67871) --- homeassistant/components/shelly/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/light.py b/homeassistant/components/shelly/light.py index b0fb9cd1a8a1d..13a7720e7ed2b 100644 --- a/homeassistant/components/shelly/light.py +++ b/homeassistant/components/shelly/light.py @@ -336,7 +336,7 @@ async def async_turn_on(self, **kwargs: Any) -> None: ATTR_RGBW_COLOR ] - if ATTR_EFFECT in kwargs: + if ATTR_EFFECT in kwargs and ATTR_COLOR_TEMP not in kwargs: # Color effect change - used only in color mode, switch device mode to color set_mode = "color" if self.wrapper.model == "SHBLB-1": From c608cafebdc28f0bb49aef83c9f8d3152964d579 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Wed, 9 Mar 2022 20:21:31 +0100 Subject: [PATCH 06/12] Make sure blueprint cache is flushed on script reload (#67899) --- homeassistant/components/script/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index 593e585c4a547..2b9c9976ce426 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -175,7 +175,7 @@ async def reload_service(service: ServiceCall) -> None: """Call a service to reload scripts.""" if (conf := await component.async_prepare_reload()) is None: return - + async_get_blueprints(hass).async_reset_cache() await _async_process_config(hass, conf, component) async def turn_on_service(service: ServiceCall) -> None: From 5a39e63d2548c707dff0163ce6b86ce9a953ab56 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 9 Mar 2022 20:22:10 +0100 Subject: [PATCH 07/12] Update radios to 0.1.1 (#67902) --- homeassistant/components/radio_browser/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/radio_browser/manifest.json b/homeassistant/components/radio_browser/manifest.json index 865d8b25ab1e7..9c6858ae27eb9 100644 --- a/homeassistant/components/radio_browser/manifest.json +++ b/homeassistant/components/radio_browser/manifest.json @@ -3,7 +3,7 @@ "name": "Radio Browser", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/radio", - "requirements": ["radios==0.1.0"], + "requirements": ["radios==0.1.1"], "codeowners": ["@frenck"], "iot_class": "cloud_polling" } diff --git a/requirements_all.txt b/requirements_all.txt index 1a22f6f89d023..0538b9332dcb6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2079,7 +2079,7 @@ quantum-gateway==0.0.6 rachiopy==1.0.3 # homeassistant.components.radio_browser -radios==0.1.0 +radios==0.1.1 # homeassistant.components.radiotherm radiotherm==2.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d802fe91bc043..d08c7b1740e87 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1295,7 +1295,7 @@ pyzerproc==0.4.8 rachiopy==1.0.3 # homeassistant.components.radio_browser -radios==0.1.0 +radios==0.1.1 # homeassistant.components.rainmachine regenmaschine==2022.01.0 From ca664ab5a5d431e9cb3002c7b5419cf5286c69fa Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 10 Mar 2022 10:32:49 +0100 Subject: [PATCH 08/12] Correct local import of paho-mqtt (#67944) * Correct local import of paho-mqtt * Remove MqttClientSetup.mqtt class attribute * Remove reference to MqttClientSetup.mqtt --- homeassistant/components/mqtt/__init__.py | 23 ++++++++++++-------- homeassistant/components/mqtt/config_flow.py | 6 ++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index c6229c2d47539..53a2544611a09 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -13,7 +13,7 @@ from operator import attrgetter import ssl import time -from typing import Any, Union, cast +from typing import TYPE_CHECKING, Any, Union, cast import uuid import attr @@ -113,6 +113,11 @@ ) from .util import _VALID_QOS_SCHEMA, valid_publish_topic, valid_subscribe_topic +if TYPE_CHECKING: + # Only import for paho-mqtt type checking here, imports are done locally + # because integrations should be able to optionally rely on MQTT. + import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel + _LOGGER = logging.getLogger(__name__) _SENTINEL = object() @@ -759,23 +764,23 @@ class Subscription: class MqttClientSetup: """Helper class to setup the paho mqtt client from config.""" - # We don't import on the top because some integrations - # should be able to optionally rely on MQTT. - import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel - def __init__(self, config: ConfigType) -> None: """Initialize the MQTT client setup helper.""" + # We don't import on the top because some integrations + # should be able to optionally rely on MQTT. + import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel + if config[CONF_PROTOCOL] == PROTOCOL_31: - proto = self.mqtt.MQTTv31 + proto = mqtt.MQTTv31 else: - proto = self.mqtt.MQTTv311 + proto = mqtt.MQTTv311 if (client_id := config.get(CONF_CLIENT_ID)) is None: # PAHO MQTT relies on the MQTT server to generate random client IDs. # However, that feature is not mandatory so we generate our own. - client_id = self.mqtt.base62(uuid.uuid4().int, padding=22) - self._client = self.mqtt.Client(client_id, protocol=proto) + client_id = mqtt.base62(uuid.uuid4().int, padding=22) + self._client = mqtt.Client(client_id, protocol=proto) # Enable logging self._client.enable_logger() diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index 99e7e9718d0ed..6697b17dfdc77 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -319,6 +319,10 @@ async def async_step_options(self, user_input=None): def try_connection(hass, broker, port, username, password, protocol="3.1"): """Test if we can connect to an MQTT broker.""" + # We don't import on the top because some integrations + # should be able to optionally rely on MQTT. + import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel + # Get the config from configuration.yaml yaml_config = hass.data.get(DATA_MQTT_CONFIG, {}) entry_config = { @@ -334,7 +338,7 @@ def try_connection(hass, broker, port, username, password, protocol="3.1"): def on_connect(client_, userdata, flags, result_code): """Handle connection result.""" - result.put(result_code == MqttClientSetup.mqtt.CONNACK_ACCEPTED) + result.put(result_code == mqtt.CONNACK_ACCEPTED) client.on_connect = on_connect From 1bfb01e0d1a5c18f01c51d350d80938eeb1a8e07 Mon Sep 17 00:00:00 2001 From: Tom Harris Date: Thu, 10 Mar 2022 10:50:36 -0500 Subject: [PATCH 09/12] Rollback pyinsteon (#67956) --- homeassistant/components/insteon/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/insteon/manifest.json b/homeassistant/components/insteon/manifest.json index 7abff39113ba5..b069f3b18a875 100644 --- a/homeassistant/components/insteon/manifest.json +++ b/homeassistant/components/insteon/manifest.json @@ -3,7 +3,7 @@ "name": "Insteon", "documentation": "https://www.home-assistant.io/integrations/insteon", "requirements": [ - "pyinsteon==1.0.16" + "pyinsteon==1.0.13" ], "codeowners": [ "@teharris1" diff --git a/requirements_all.txt b/requirements_all.txt index 0538b9332dcb6..0dac21d8cbfbe 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1589,7 +1589,7 @@ pyialarm==1.9.0 pyicloud==1.0.0 # homeassistant.components.insteon -pyinsteon==1.0.16 +pyinsteon==1.0.13 # homeassistant.components.intesishome pyintesishome==1.7.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d08c7b1740e87..29a9b6e80888d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1000,7 +1000,7 @@ pyialarm==1.9.0 pyicloud==1.0.0 # homeassistant.components.insteon -pyinsteon==1.0.16 +pyinsteon==1.0.13 # homeassistant.components.ipma pyipma==2.0.5 From 7de5e070fbca19ab932b46b8934268b5fd18463d Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Fri, 11 Mar 2022 18:24:08 +0100 Subject: [PATCH 10/12] Bump pysabnzbd to 1.1.1 (#67971) --- homeassistant/components/sabnzbd/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sabnzbd/manifest.json b/homeassistant/components/sabnzbd/manifest.json index 08fb1388b38e8..f6cbd95820650 100644 --- a/homeassistant/components/sabnzbd/manifest.json +++ b/homeassistant/components/sabnzbd/manifest.json @@ -2,7 +2,7 @@ "domain": "sabnzbd", "name": "SABnzbd", "documentation": "https://www.home-assistant.io/integrations/sabnzbd", - "requirements": ["pysabnzbd==1.1.0"], + "requirements": ["pysabnzbd==1.1.1"], "dependencies": ["configurator"], "after_dependencies": ["discovery"], "codeowners": [], diff --git a/requirements_all.txt b/requirements_all.txt index 0dac21d8cbfbe..195572800c268 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1813,7 +1813,7 @@ pyrituals==0.0.6 pyruckus==0.12 # homeassistant.components.sabnzbd -pysabnzbd==1.1.0 +pysabnzbd==1.1.1 # homeassistant.components.saj pysaj==0.0.16 From 7fb76c68bb5a146ff5d4e7689acb455b2f43556a Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 11 Mar 2022 09:25:55 -0800 Subject: [PATCH 11/12] Bumped version to 2022.3.4 --- homeassistant/const.py | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index c1d791aaf07a8..9f3d5e1c0f75d 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -7,7 +7,7 @@ MAJOR_VERSION: Final = 2022 MINOR_VERSION: Final = 3 -PATCH_VERSION: Final = "3" +PATCH_VERSION: Final = "4" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0) diff --git a/setup.cfg b/setup.cfg index a3c8068edb1aa..5cdcab49caf60 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = homeassistant -version = 2022.3.3 +version = 2022.3.4 author = The Home Assistant Authors author_email = hello@home-assistant.io license = Apache-2.0 From 3de341099fc8c586e8bef8ba1d2b432a99a66853 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Fri, 11 Mar 2022 23:45:29 +0000 Subject: [PATCH 12/12] Bump pymediaroom (#68016) --- homeassistant/components/mediaroom/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/mediaroom/manifest.json b/homeassistant/components/mediaroom/manifest.json index 63007f88bbbaf..c49368d2e276a 100644 --- a/homeassistant/components/mediaroom/manifest.json +++ b/homeassistant/components/mediaroom/manifest.json @@ -2,7 +2,7 @@ "domain": "mediaroom", "name": "Mediaroom", "documentation": "https://www.home-assistant.io/integrations/mediaroom", - "requirements": ["pymediaroom==0.6.4.1"], + "requirements": ["pymediaroom==0.6.5.4"], "codeowners": ["@dgomes"], "iot_class": "local_polling", "loggers": ["pymediaroom"] diff --git a/requirements_all.txt b/requirements_all.txt index 195572800c268..8246fd24dbb01 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1670,7 +1670,7 @@ pymata-express==1.19 pymazda==0.3.2 # homeassistant.components.mediaroom -pymediaroom==0.6.4.1 +pymediaroom==0.6.5.4 # homeassistant.components.melcloud pymelcloud==2.5.6