diff --git a/homeassistant/components/discord/notify.py b/homeassistant/components/discord/notify.py index 41137e1a32c..2e13b68225c 100644 --- a/homeassistant/components/discord/notify.py +++ b/homeassistant/components/discord/notify.py @@ -20,9 +20,13 @@ _LOGGER = logging.getLogger(__name__) 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 @@ class DiscordNotificationService(BaseNotificationService): 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: diff --git a/homeassistant/components/insteon/manifest.json b/homeassistant/components/insteon/manifest.json index 7abff39113b..b069f3b18a8 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/homeassistant/components/kodi/media_player.py b/homeassistant/components/kodi/media_player.py index 53798a7ccd9..e1dae879bf8 100644 --- a/homeassistant/components/kodi/media_player.py +++ b/homeassistant/components/kodi/media_player.py @@ -717,6 +717,8 @@ class KodiEntity(MediaPlayerEntity): 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 [ diff --git a/homeassistant/components/mediaroom/manifest.json b/homeassistant/components/mediaroom/manifest.json index 63007f88bbb..c49368d2e27 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/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index c6229c2d475..53a2544611a 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -13,7 +13,7 @@ import logging 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 .models import ( ) 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 99e7e9718d0..6697b17dfdc 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -319,6 +319,10 @@ class MQTTOptionsFlowHandler(config_entries.OptionsFlow): 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 diff --git a/homeassistant/components/radio_browser/manifest.json b/homeassistant/components/radio_browser/manifest.json index 865d8b25ab1..9c6858ae27e 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/homeassistant/components/sabnzbd/manifest.json b/homeassistant/components/sabnzbd/manifest.json index 08fb1388b38..f6cbd958206 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/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index 593e585c4a5..2b9c9976ce4 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -175,7 +175,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """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: diff --git a/homeassistant/components/shelly/light.py b/homeassistant/components/shelly/light.py index b0fb9cd1a8a..13a7720e7ed 100644 --- a/homeassistant/components/shelly/light.py +++ b/homeassistant/components/shelly/light.py @@ -336,7 +336,7 @@ class BlockShellyLight(ShellyBlockEntity, LightEntity): 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": diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index fd819e5ad33..4789490ef0d 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -101,6 +101,7 @@ class Sun(Entity): 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: diff --git a/homeassistant/components/zwave_js/manifest.json b/homeassistant/components/zwave_js/manifest.json index 6a892b2791d..8d1a9091bc0 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/homeassistant/const.py b/homeassistant/const.py index c1d791aaf07..9f3d5e1c0f7 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -7,7 +7,7 @@ from .backports.enum import StrEnum 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/requirements_all.txt b/requirements_all.txt index e74e0915572..8246fd24dbb 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 @@ -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 @@ -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 @@ -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 @@ -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 2031915fc1d..29a9b6e8088 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 @@ -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 @@ -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 diff --git a/setup.cfg b/setup.cfg index a3c8068edb1..5cdcab49caf 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