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_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:
|
||||
|
@@ -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"
|
||||
|
@@ -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 [
|
||||
|
@@ -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"]
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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"
|
||||
}
|
||||
|
@@ -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": [],
|
||||
|
@@ -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:
|
||||
|
@@ -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":
|
||||
|
@@ -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:
|
||||
|
@@ -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",
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user