mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Merge pull request #68001 from home-assistant/rc
This commit is contained in:
@@ -20,9 +20,13 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
ATTR_EMBED = "embed"
|
ATTR_EMBED = "embed"
|
||||||
ATTR_EMBED_AUTHOR = "author"
|
ATTR_EMBED_AUTHOR = "author"
|
||||||
|
ATTR_EMBED_COLOR = "color"
|
||||||
|
ATTR_EMBED_DESCRIPTION = "description"
|
||||||
ATTR_EMBED_FIELDS = "fields"
|
ATTR_EMBED_FIELDS = "fields"
|
||||||
ATTR_EMBED_FOOTER = "footer"
|
ATTR_EMBED_FOOTER = "footer"
|
||||||
|
ATTR_EMBED_TITLE = "title"
|
||||||
ATTR_EMBED_THUMBNAIL = "thumbnail"
|
ATTR_EMBED_THUMBNAIL = "thumbnail"
|
||||||
|
ATTR_EMBED_URL = "url"
|
||||||
ATTR_IMAGES = "images"
|
ATTR_IMAGES = "images"
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_TOKEN): cv.string})
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.Required(CONF_TOKEN): cv.string})
|
||||||
@@ -64,10 +68,16 @@ class DiscordNotificationService(BaseNotificationService):
|
|||||||
embeds: list[nextcord.Embed] = []
|
embeds: list[nextcord.Embed] = []
|
||||||
if ATTR_EMBED in data:
|
if ATTR_EMBED in data:
|
||||||
embedding = data[ATTR_EMBED]
|
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 []
|
fields = embedding.get(ATTR_EMBED_FIELDS) or []
|
||||||
|
|
||||||
if embedding:
|
if embedding:
|
||||||
embed = nextcord.Embed(**embedding)
|
embed = nextcord.Embed(
|
||||||
|
title=title, description=description, color=color, url=url
|
||||||
|
)
|
||||||
for field in fields:
|
for field in fields:
|
||||||
embed.add_field(**field)
|
embed.add_field(**field)
|
||||||
if ATTR_EMBED_FOOTER in embedding:
|
if ATTR_EMBED_FOOTER in embedding:
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"name": "Insteon",
|
"name": "Insteon",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/insteon",
|
"documentation": "https://www.home-assistant.io/integrations/insteon",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pyinsteon==1.0.16"
|
"pyinsteon==1.0.13"
|
||||||
],
|
],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
"@teharris1"
|
"@teharris1"
|
||||||
|
@@ -717,6 +717,8 @@ class KodiEntity(MediaPlayerEntity):
|
|||||||
await self._kodi.play_channel(int(media_id))
|
await self._kodi.play_channel(int(media_id))
|
||||||
elif media_type_lower == MEDIA_TYPE_PLAYLIST:
|
elif media_type_lower == MEDIA_TYPE_PLAYLIST:
|
||||||
await self._kodi.play_playlist(int(media_id))
|
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":
|
elif media_type_lower == "directory":
|
||||||
await self._kodi.play_directory(media_id)
|
await self._kodi.play_directory(media_id)
|
||||||
elif media_type_lower in [
|
elif media_type_lower in [
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"domain": "mediaroom",
|
"domain": "mediaroom",
|
||||||
"name": "Mediaroom",
|
"name": "Mediaroom",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/mediaroom",
|
"documentation": "https://www.home-assistant.io/integrations/mediaroom",
|
||||||
"requirements": ["pymediaroom==0.6.4.1"],
|
"requirements": ["pymediaroom==0.6.5.4"],
|
||||||
"codeowners": ["@dgomes"],
|
"codeowners": ["@dgomes"],
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["pymediaroom"]
|
"loggers": ["pymediaroom"]
|
||||||
|
@@ -13,7 +13,7 @@ import logging
|
|||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
import time
|
||||||
from typing import Any, Union, cast
|
from typing import TYPE_CHECKING, Any, Union, cast
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
@@ -113,6 +113,11 @@ from .models import (
|
|||||||
)
|
)
|
||||||
from .util import _VALID_QOS_SCHEMA, valid_publish_topic, valid_subscribe_topic
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
_SENTINEL = object()
|
_SENTINEL = object()
|
||||||
@@ -759,23 +764,23 @@ class Subscription:
|
|||||||
class MqttClientSetup:
|
class MqttClientSetup:
|
||||||
"""Helper class to setup the paho mqtt client from config."""
|
"""Helper class to setup the paho mqtt client from config."""
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigType) -> None:
|
||||||
|
"""Initialize the MQTT client setup helper."""
|
||||||
|
|
||||||
# We don't import on the top because some integrations
|
# We don't import on the top because some integrations
|
||||||
# should be able to optionally rely on MQTT.
|
# should be able to optionally rely on MQTT.
|
||||||
import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel
|
import paho.mqtt.client as mqtt # pylint: disable=import-outside-toplevel
|
||||||
|
|
||||||
def __init__(self, config: ConfigType) -> None:
|
|
||||||
"""Initialize the MQTT client setup helper."""
|
|
||||||
|
|
||||||
if config[CONF_PROTOCOL] == PROTOCOL_31:
|
if config[CONF_PROTOCOL] == PROTOCOL_31:
|
||||||
proto = self.mqtt.MQTTv31
|
proto = mqtt.MQTTv31
|
||||||
else:
|
else:
|
||||||
proto = self.mqtt.MQTTv311
|
proto = mqtt.MQTTv311
|
||||||
|
|
||||||
if (client_id := config.get(CONF_CLIENT_ID)) is None:
|
if (client_id := config.get(CONF_CLIENT_ID)) is None:
|
||||||
# PAHO MQTT relies on the MQTT server to generate random client IDs.
|
# PAHO MQTT relies on the MQTT server to generate random client IDs.
|
||||||
# However, that feature is not mandatory so we generate our own.
|
# However, that feature is not mandatory so we generate our own.
|
||||||
client_id = self.mqtt.base62(uuid.uuid4().int, padding=22)
|
client_id = mqtt.base62(uuid.uuid4().int, padding=22)
|
||||||
self._client = self.mqtt.Client(client_id, protocol=proto)
|
self._client = mqtt.Client(client_id, protocol=proto)
|
||||||
|
|
||||||
# Enable logging
|
# Enable logging
|
||||||
self._client.enable_logger()
|
self._client.enable_logger()
|
||||||
|
@@ -319,6 +319,10 @@ class MQTTOptionsFlowHandler(config_entries.OptionsFlow):
|
|||||||
|
|
||||||
def try_connection(hass, broker, port, username, password, protocol="3.1"):
|
def try_connection(hass, broker, port, username, password, protocol="3.1"):
|
||||||
"""Test if we can connect to an MQTT broker."""
|
"""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
|
# Get the config from configuration.yaml
|
||||||
yaml_config = hass.data.get(DATA_MQTT_CONFIG, {})
|
yaml_config = hass.data.get(DATA_MQTT_CONFIG, {})
|
||||||
entry_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):
|
def on_connect(client_, userdata, flags, result_code):
|
||||||
"""Handle connection result."""
|
"""Handle connection result."""
|
||||||
result.put(result_code == MqttClientSetup.mqtt.CONNACK_ACCEPTED)
|
result.put(result_code == mqtt.CONNACK_ACCEPTED)
|
||||||
|
|
||||||
client.on_connect = on_connect
|
client.on_connect = on_connect
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"name": "Radio Browser",
|
"name": "Radio Browser",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/radio",
|
"documentation": "https://www.home-assistant.io/integrations/radio",
|
||||||
"requirements": ["radios==0.1.0"],
|
"requirements": ["radios==0.1.1"],
|
||||||
"codeowners": ["@frenck"],
|
"codeowners": ["@frenck"],
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"domain": "sabnzbd",
|
"domain": "sabnzbd",
|
||||||
"name": "SABnzbd",
|
"name": "SABnzbd",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/sabnzbd",
|
"documentation": "https://www.home-assistant.io/integrations/sabnzbd",
|
||||||
"requirements": ["pysabnzbd==1.1.0"],
|
"requirements": ["pysabnzbd==1.1.1"],
|
||||||
"dependencies": ["configurator"],
|
"dependencies": ["configurator"],
|
||||||
"after_dependencies": ["discovery"],
|
"after_dependencies": ["discovery"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
|
@@ -175,7 +175,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
"""Call a service to reload scripts."""
|
"""Call a service to reload scripts."""
|
||||||
if (conf := await component.async_prepare_reload()) is None:
|
if (conf := await component.async_prepare_reload()) is None:
|
||||||
return
|
return
|
||||||
|
async_get_blueprints(hass).async_reset_cache()
|
||||||
await _async_process_config(hass, conf, component)
|
await _async_process_config(hass, conf, component)
|
||||||
|
|
||||||
async def turn_on_service(service: ServiceCall) -> None:
|
async def turn_on_service(service: ServiceCall) -> None:
|
||||||
|
@@ -336,7 +336,7 @@ class BlockShellyLight(ShellyBlockEntity, LightEntity):
|
|||||||
ATTR_RGBW_COLOR
|
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
|
# Color effect change - used only in color mode, switch device mode to color
|
||||||
set_mode = "color"
|
set_mode = "color"
|
||||||
if self.wrapper.model == "SHBLB-1":
|
if self.wrapper.model == "SHBLB-1":
|
||||||
|
@@ -101,6 +101,7 @@ class Sun(Entity):
|
|||||||
self.rising = self.phase = None
|
self.rising = self.phase = None
|
||||||
self._next_change = None
|
self._next_change = None
|
||||||
|
|
||||||
|
@callback
|
||||||
def update_location(_event):
|
def update_location(_event):
|
||||||
location, elevation = get_astral_location(self.hass)
|
location, elevation = get_astral_location(self.hass)
|
||||||
if location == self.location:
|
if location == self.location:
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"name": "Z-Wave JS",
|
"name": "Z-Wave JS",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/zwave_js",
|
"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"],
|
"codeowners": ["@home-assistant/z-wave"],
|
||||||
"dependencies": ["usb", "http", "websocket_api"],
|
"dependencies": ["usb", "http", "websocket_api"],
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
|
@@ -7,7 +7,7 @@ from .backports.enum import StrEnum
|
|||||||
|
|
||||||
MAJOR_VERSION: Final = 2022
|
MAJOR_VERSION: Final = 2022
|
||||||
MINOR_VERSION: Final = 3
|
MINOR_VERSION: Final = 3
|
||||||
PATCH_VERSION: Final = "3"
|
PATCH_VERSION: Final = "4"
|
||||||
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
||||||
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
|
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
|
||||||
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0)
|
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0)
|
||||||
|
@@ -1589,7 +1589,7 @@ pyialarm==1.9.0
|
|||||||
pyicloud==1.0.0
|
pyicloud==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.insteon
|
# homeassistant.components.insteon
|
||||||
pyinsteon==1.0.16
|
pyinsteon==1.0.13
|
||||||
|
|
||||||
# homeassistant.components.intesishome
|
# homeassistant.components.intesishome
|
||||||
pyintesishome==1.7.6
|
pyintesishome==1.7.6
|
||||||
@@ -1670,7 +1670,7 @@ pymata-express==1.19
|
|||||||
pymazda==0.3.2
|
pymazda==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.mediaroom
|
# homeassistant.components.mediaroom
|
||||||
pymediaroom==0.6.4.1
|
pymediaroom==0.6.5.4
|
||||||
|
|
||||||
# homeassistant.components.melcloud
|
# homeassistant.components.melcloud
|
||||||
pymelcloud==2.5.6
|
pymelcloud==2.5.6
|
||||||
@@ -1813,7 +1813,7 @@ pyrituals==0.0.6
|
|||||||
pyruckus==0.12
|
pyruckus==0.12
|
||||||
|
|
||||||
# homeassistant.components.sabnzbd
|
# homeassistant.components.sabnzbd
|
||||||
pysabnzbd==1.1.0
|
pysabnzbd==1.1.1
|
||||||
|
|
||||||
# homeassistant.components.saj
|
# homeassistant.components.saj
|
||||||
pysaj==0.0.16
|
pysaj==0.0.16
|
||||||
@@ -2079,7 +2079,7 @@ quantum-gateway==0.0.6
|
|||||||
rachiopy==1.0.3
|
rachiopy==1.0.3
|
||||||
|
|
||||||
# homeassistant.components.radio_browser
|
# homeassistant.components.radio_browser
|
||||||
radios==0.1.0
|
radios==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.radiotherm
|
# homeassistant.components.radiotherm
|
||||||
radiotherm==2.1.0
|
radiotherm==2.1.0
|
||||||
@@ -2566,7 +2566,7 @@ zigpy==0.43.0
|
|||||||
zm-py==0.5.2
|
zm-py==0.5.2
|
||||||
|
|
||||||
# homeassistant.components.zwave_js
|
# homeassistant.components.zwave_js
|
||||||
zwave-js-server-python==0.35.1
|
zwave-js-server-python==0.35.2
|
||||||
|
|
||||||
# homeassistant.components.zwave_me
|
# homeassistant.components.zwave_me
|
||||||
zwave_me_ws==0.2.1
|
zwave_me_ws==0.2.1
|
||||||
|
@@ -1000,7 +1000,7 @@ pyialarm==1.9.0
|
|||||||
pyicloud==1.0.0
|
pyicloud==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.insteon
|
# homeassistant.components.insteon
|
||||||
pyinsteon==1.0.16
|
pyinsteon==1.0.13
|
||||||
|
|
||||||
# homeassistant.components.ipma
|
# homeassistant.components.ipma
|
||||||
pyipma==2.0.5
|
pyipma==2.0.5
|
||||||
@@ -1295,7 +1295,7 @@ pyzerproc==0.4.8
|
|||||||
rachiopy==1.0.3
|
rachiopy==1.0.3
|
||||||
|
|
||||||
# homeassistant.components.radio_browser
|
# homeassistant.components.radio_browser
|
||||||
radios==0.1.0
|
radios==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.rainmachine
|
# homeassistant.components.rainmachine
|
||||||
regenmaschine==2022.01.0
|
regenmaschine==2022.01.0
|
||||||
@@ -1588,7 +1588,7 @@ zigpy-znp==0.7.0
|
|||||||
zigpy==0.43.0
|
zigpy==0.43.0
|
||||||
|
|
||||||
# homeassistant.components.zwave_js
|
# homeassistant.components.zwave_js
|
||||||
zwave-js-server-python==0.35.1
|
zwave-js-server-python==0.35.2
|
||||||
|
|
||||||
# homeassistant.components.zwave_me
|
# homeassistant.components.zwave_me
|
||||||
zwave_me_ws==0.2.1
|
zwave_me_ws==0.2.1
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = homeassistant
|
name = homeassistant
|
||||||
version = 2022.3.3
|
version = 2022.3.4
|
||||||
author = The Home Assistant Authors
|
author = The Home Assistant Authors
|
||||||
author_email = hello@home-assistant.io
|
author_email = hello@home-assistant.io
|
||||||
license = Apache-2.0
|
license = Apache-2.0
|
||||||
|
Reference in New Issue
Block a user