From 291d36693314fff6ba9c7da853fec1d666de2bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jedelsk=C3=BD?= <8687359+jjedelsky@users.noreply.github.com> Date: Mon, 17 Oct 2022 09:42:20 +0200 Subject: [PATCH 01/19] Handle ReadTimeout during wolflink setup (#78135) * Handle ReadTimeout during wolflink setup * Reorder imports Co-authored-by: Yevhenii Vaskivskyi * Reorder exceptions Co-authored-by: Yevhenii Vaskivskyi * Use RequestError instead of ConnectError, ReadTimeout, and ConnectTimeout Co-authored-by: Yevhenii Vaskivskyi --- homeassistant/components/wolflink/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wolflink/__init__.py b/homeassistant/components/wolflink/__init__.py index 9d76c61806b..290e7337617 100644 --- a/homeassistant/components/wolflink/__init__.py +++ b/homeassistant/components/wolflink/__init__.py @@ -2,7 +2,7 @@ from datetime import timedelta import logging -from httpx import ConnectError, ConnectTimeout +from httpx import RequestError from wolf_smartset.token_auth import InvalidAuth from wolf_smartset.wolf_client import FetchFailed, ParameterReadError, WolfClient @@ -74,7 +74,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: for parameter in parameters if parameter.value_id in values } - except ConnectError as exception: + except RequestError as exception: raise UpdateFailed( f"Error communicating with API: {exception}" ) from exception @@ -134,7 +134,7 @@ async def fetch_parameters_init(client: WolfClient, gateway_id: int, device_id: """Fetch all available parameters with usage of WolfClient but handles all exceptions and results in ConfigEntryNotReady.""" try: return await fetch_parameters(client, gateway_id, device_id) - except (ConnectError, ConnectTimeout, FetchFailed) as exception: + except (FetchFailed, RequestError) as exception: raise ConfigEntryNotReady( f"Error communicating with API: {exception}" ) from exception From b3612b430b047d0e7897a7c1dbe1e38558221697 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Fri, 7 Oct 2022 20:57:12 +0200 Subject: [PATCH 02/19] Bump plugwise to v0.21.4 (#79831) --- homeassistant/components/plugwise/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/plugwise/manifest.json b/homeassistant/components/plugwise/manifest.json index 9c8ea6f3be7..1b17f3e49f5 100644 --- a/homeassistant/components/plugwise/manifest.json +++ b/homeassistant/components/plugwise/manifest.json @@ -2,7 +2,7 @@ "domain": "plugwise", "name": "Plugwise", "documentation": "https://www.home-assistant.io/integrations/plugwise", - "requirements": ["plugwise==0.21.3"], + "requirements": ["plugwise==0.21.4"], "codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"], "zeroconf": ["_plugwise._tcp.local."], "config_flow": true, diff --git a/requirements_all.txt b/requirements_all.txt index e1a1911b95f..69a47eb00d7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1306,7 +1306,7 @@ plexauth==0.0.6 plexwebsocket==0.0.13 # homeassistant.components.plugwise -plugwise==0.21.3 +plugwise==0.21.4 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 628e8f869cb..e888858dc5e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -933,7 +933,7 @@ plexauth==0.0.6 plexwebsocket==0.0.13 # homeassistant.components.plugwise -plugwise==0.21.3 +plugwise==0.21.4 # homeassistant.components.plum_lightpad plumlightpad==0.0.11 From 15def407841fc1039c2c0ddf67bd294b9dd35c7d Mon Sep 17 00:00:00 2001 From: Jeef Date: Sat, 15 Oct 2022 14:09:00 -0600 Subject: [PATCH 03/19] Fix Intellifire UDP timeout (#80204) --- homeassistant/components/intellifire/config_flow.py | 4 ++-- homeassistant/components/intellifire/manifest.json | 8 ++++++-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/intellifire/config_flow.py b/homeassistant/components/intellifire/config_flow.py index 4556668b702..d2b019cb381 100644 --- a/homeassistant/components/intellifire/config_flow.py +++ b/homeassistant/components/intellifire/config_flow.py @@ -38,7 +38,7 @@ async def validate_host_input(host: str, dhcp_mode: bool = False) -> str: """ LOGGER.debug("Instantiating IntellifireAPI with host: [%s]", host) api = IntellifireAPILocal(fireplace_ip=host) - await api.poll(supress_warnings=dhcp_mode) + await api.poll(suppress_warnings=dhcp_mode) serial = api.data.serial LOGGER.debug("Found a fireplace: %s", serial) @@ -62,7 +62,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def _find_fireplaces(self): """Perform UDP discovery.""" fireplace_finder = AsyncUDPFireplaceFinder() - discovered_hosts = await fireplace_finder.search_fireplace(timeout=1) + discovered_hosts = await fireplace_finder.search_fireplace(timeout=12) configured_hosts = { entry.data[CONF_HOST] for entry in self._async_current_entries(include_ignore=False) diff --git a/homeassistant/components/intellifire/manifest.json b/homeassistant/components/intellifire/manifest.json index e2ae4bb8abe..67dc5a96ad7 100644 --- a/homeassistant/components/intellifire/manifest.json +++ b/homeassistant/components/intellifire/manifest.json @@ -3,9 +3,13 @@ "name": "IntelliFire", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/intellifire", - "requirements": ["intellifire4py==2.0.1"], + "requirements": ["intellifire4py==2.2.1"], "codeowners": ["@jeeftor"], "iot_class": "local_polling", "loggers": ["intellifire4py"], - "dhcp": [{ "hostname": "zentrios-*" }] + "dhcp": [ + { + "hostname": "zentrios-*" + } + ] } diff --git a/requirements_all.txt b/requirements_all.txt index 69a47eb00d7..de635d42499 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -934,7 +934,7 @@ inkbird-ble==0.5.5 insteon-frontend-home-assistant==0.2.0 # homeassistant.components.intellifire -intellifire4py==2.0.1 +intellifire4py==2.2.1 # homeassistant.components.iotawatt iotawattpy==0.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e888858dc5e..ca26b35de93 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -690,7 +690,7 @@ inkbird-ble==0.5.5 insteon-frontend-home-assistant==0.2.0 # homeassistant.components.intellifire -intellifire4py==2.0.1 +intellifire4py==2.2.1 # homeassistant.components.iotawatt iotawattpy==0.1.0 From b2034118851c88bd5fe45d02597b5c4f9c367a52 Mon Sep 17 00:00:00 2001 From: rozie Date: Wed, 19 Oct 2022 22:48:39 +0200 Subject: [PATCH 04/19] Fix solaredge missing data value (#80321) * Fix issue #80263: use get to fetch dict value * use None instead -1 for unknown value * Update homeassistant/components/solaredge/coordinator.py Co-authored-by: Franck Nijhof * Add guards for not multipling None * Missing if added Co-authored-by: Franck Nijhof --- homeassistant/components/solaredge/coordinator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/solaredge/coordinator.py b/homeassistant/components/solaredge/coordinator.py index 7d3e949fc10..5def236598a 100644 --- a/homeassistant/components/solaredge/coordinator.py +++ b/homeassistant/components/solaredge/coordinator.py @@ -276,17 +276,19 @@ class SolarEdgePowerFlowDataService(SolarEdgeDataService): for key, value in power_flow.items(): if key in ["LOAD", "PV", "GRID", "STORAGE"]: - self.data[key] = value["currentPower"] + self.data[key] = value.get("currentPower") self.attributes[key] = {"status": value["status"]} if key in ["GRID"]: export = key.lower() in power_to - self.data[key] *= -1 if export else 1 + if self.data[key]: + self.data[key] *= -1 if export else 1 self.attributes[key]["flow"] = "export" if export else "import" if key in ["STORAGE"]: charge = key.lower() in power_to - self.data[key] *= -1 if charge else 1 + if self.data[key]: + self.data[key] *= -1 if charge else 1 self.attributes[key]["flow"] = "charge" if charge else "discharge" self.attributes[key]["soc"] = value["chargeLevel"] From a0eade763200ea402f1c721105839df83c61fda2 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Sat, 15 Oct 2022 12:15:28 +0300 Subject: [PATCH 05/19] Fix Shelly EM negative power factor (#80348) --- homeassistant/components/shelly/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/sensor.py b/homeassistant/components/shelly/sensor.py index bc55aa3e865..fe7ca1a9f83 100644 --- a/homeassistant/components/shelly/sensor.py +++ b/homeassistant/components/shelly/sensor.py @@ -144,7 +144,7 @@ SENSORS: Final = { key="emeter|powerFactor", name="Power Factor", native_unit_of_measurement=PERCENTAGE, - value=lambda value: round(value * 100, 1), + value=lambda value: abs(round(value * 100, 1)), device_class=SensorDeviceClass.POWER_FACTOR, state_class=SensorStateClass.MEASUREMENT, ), From df75346dca6a239a2bdffc4362c1be6c2309be1d Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Mon, 17 Oct 2022 04:13:11 -0400 Subject: [PATCH 06/19] Fix updating Amcrest binary sensors (#80365) * Fix updating Amcrest binary sensors As detailed in https://bugs.python.org/issue32113, a generator expression cannot be used with asynchronous components, even that the resulting elements of the generator are normal objects. Manually iterate over the event codes and check if the events have happened. Escape early on the first event that is triggered such that this is functionally equivalent to using `any`. * Update homeassistant/components/amcrest/binary_sensor.py Co-authored-by: Martin Hjelmare Co-authored-by: Martin Hjelmare --- homeassistant/components/amcrest/binary_sensor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/amcrest/binary_sensor.py b/homeassistant/components/amcrest/binary_sensor.py index 4d438c7c3bf..e71a5cda538 100644 --- a/homeassistant/components/amcrest/binary_sensor.py +++ b/homeassistant/components/amcrest/binary_sensor.py @@ -215,10 +215,12 @@ class AmcrestBinarySensor(BinarySensorEntity): raise ValueError(f"Binary sensor {self.name} event codes not set") try: - self._attr_is_on = any( # type: ignore[arg-type] - len(await self._api.async_event_channels_happened(event_code)) > 0 - for event_code in event_codes - ) + for event_code in event_codes: + if await self._api.async_event_channels_happened(event_code): + self._attr_is_on = True + break + else: + self._attr_is_on = False except AmcrestError as error: log_update_error(_LOGGER, "update", self.name, "binary sensor", error) return From c73162e5ea539417a9b2b7761cfc09a1491e3e79 Mon Sep 17 00:00:00 2001 From: uvjustin <46082645+uvjustin@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:12:45 +0800 Subject: [PATCH 07/19] Fix stream recorder with orientation transforms (#80370) Find moov instead of using fixed location --- homeassistant/components/stream/fmp4utils.py | 22 +++++++++++++++++--- tests/components/stream/test_hls.py | 2 +- tests/components/stream/test_ll_hls.py | 2 +- tests/components/stream/test_worker.py | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/stream/fmp4utils.py b/homeassistant/components/stream/fmp4utils.py index ed9dd6a9724..35d32d5b0e3 100644 --- a/homeassistant/components/stream/fmp4utils.py +++ b/homeassistant/components/stream/fmp4utils.py @@ -4,6 +4,8 @@ from __future__ import annotations from collections.abc import Generator from typing import TYPE_CHECKING +from homeassistant.exceptions import HomeAssistantError + if TYPE_CHECKING: from io import BufferedIOBase @@ -11,7 +13,7 @@ if TYPE_CHECKING: def find_box( mp4_bytes: bytes, target_type: bytes, box_start: int = 0 ) -> Generator[int, None, None]: - """Find location of first box (or sub_box if box_start provided) of given type.""" + """Find location of first box (or sub box if box_start provided) of given type.""" if box_start == 0: index = 0 box_end = len(mp4_bytes) @@ -141,12 +143,26 @@ def get_codec_string(mp4_bytes: bytes) -> str: return ",".join(codecs) +def find_moov(mp4_io: BufferedIOBase) -> int: + """Find location of moov atom in a BufferedIOBase mp4.""" + index = 0 + while 1: + mp4_io.seek(index) + box_header = mp4_io.read(8) + if len(box_header) != 8: + raise HomeAssistantError("moov atom not found") + if box_header[4:8] == b"moov": + return index + index += int.from_bytes(box_header[0:4], byteorder="big") + + def read_init(bytes_io: BufferedIOBase) -> bytes: """Read the init from a mp4 file.""" - bytes_io.seek(24) + moov_loc = find_moov(bytes_io) + bytes_io.seek(moov_loc) moov_len = int.from_bytes(bytes_io.read(4), byteorder="big") bytes_io.seek(0) - return bytes_io.read(24 + moov_len) + return bytes_io.read(moov_loc + moov_len) ZERO32 = b"\x00\x00\x00\x00" diff --git a/tests/components/stream/test_hls.py b/tests/components/stream/test_hls.py index 204b460b026..e9da793369f 100644 --- a/tests/components/stream/test_hls.py +++ b/tests/components/stream/test_hls.py @@ -29,7 +29,7 @@ from .common import ( from tests.common import async_fire_time_changed STREAM_SOURCE = "some-stream-source" -INIT_BYTES = b"init" +INIT_BYTES = b"\x00\x00\x00\x08moov" FAKE_PAYLOAD = b"fake-payload" SEGMENT_DURATION = 10 TEST_TIMEOUT = 5.0 # Lower than 9s home assistant timeout diff --git a/tests/components/stream/test_ll_hls.py b/tests/components/stream/test_ll_hls.py index 5755617f393..baad3043547 100644 --- a/tests/components/stream/test_ll_hls.py +++ b/tests/components/stream/test_ll_hls.py @@ -30,7 +30,7 @@ TEST_PART_DURATION = 0.75 NUM_PART_SEGMENTS = int(-(-SEGMENT_DURATION // TEST_PART_DURATION)) PART_INDEPENDENT_PERIOD = int(1 / TEST_PART_DURATION) or 1 BYTERANGE_LENGTH = 1 -INIT_BYTES = b"init" +INIT_BYTES = b"\x00\x00\x00\x08moov" SEQUENCE_BYTES = bytearray(range(NUM_PART_SEGMENTS * BYTERANGE_LENGTH)) ALT_SEQUENCE_BYTES = bytearray(range(20, 20 + NUM_PART_SEGMENTS * BYTERANGE_LENGTH)) VERY_LARGE_LAST_BYTE_POS = 9007199254740991 diff --git a/tests/components/stream/test_worker.py b/tests/components/stream/test_worker.py index 00d735df74d..54400af65ab 100644 --- a/tests/components/stream/test_worker.py +++ b/tests/components/stream/test_worker.py @@ -242,7 +242,7 @@ class FakePyAvBuffer: # Forward to appropriate FakeStream packet.stream.mux(packet) # Make new init/part data available to the worker - self.memory_file.write(b"0") + self.memory_file.write(b"\x00\x00\x00\x00moov") def close(self): """Close the buffer.""" From b2e0d7614582be0c2bd7f2a8df72e6b2a402a48c Mon Sep 17 00:00:00 2001 From: Ivan Puddu Date: Tue, 18 Oct 2022 22:53:34 +0200 Subject: [PATCH 08/19] Skip webostv trigger validation before the domain is setup (#80372) * Skip trigger validation before the domain is setup * Included None as return type * Keep function signature intact. Check at the source --- homeassistant/components/webostv/device_trigger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/webostv/device_trigger.py b/homeassistant/components/webostv/device_trigger.py index 859accc86e6..ef3e74a7daa 100644 --- a/homeassistant/components/webostv/device_trigger.py +++ b/homeassistant/components/webostv/device_trigger.py @@ -46,7 +46,8 @@ async def async_validate_trigger_config( device_id = config[CONF_DEVICE_ID] try: device = async_get_device_entry_by_device_id(hass, device_id) - async_get_client_wrapper_by_device_entry(hass, device) + if DOMAIN in hass.data: + async_get_client_wrapper_by_device_entry(hass, device) except ValueError as err: raise InvalidDeviceAutomationConfig(err) from err From 8c811ef16eaec30075e360821fc2a9e89e7cd621 Mon Sep 17 00:00:00 2001 From: definitio <37266727+definitio@users.noreply.github.com> Date: Sat, 15 Oct 2022 23:29:15 +0300 Subject: [PATCH 09/19] Fix "Unknown power_off command" for Samsung H6410 (#80386) --- homeassistant/components/samsungtv/bridge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/samsungtv/bridge.py b/homeassistant/components/samsungtv/bridge.py index f1618bfba14..502c7f2bbb6 100644 --- a/homeassistant/components/samsungtv/bridge.py +++ b/homeassistant/components/samsungtv/bridge.py @@ -69,7 +69,7 @@ from .const import ( KEY_PRESS_TIMEOUT = 1.2 -ENCRYPTED_MODEL_USES_POWER_OFF = {"H6400"} +ENCRYPTED_MODEL_USES_POWER_OFF = {"H6400", "H6410"} ENCRYPTED_MODEL_USES_POWER = {"JU6400", "JU641D"} REST_EXCEPTIONS = (HttpApiError, AsyncioTimeoutError, ResponseError) From 7e3abd9db5c7ef5d5ee21bd738b85fea03858fec Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 16 Oct 2022 02:14:15 -1000 Subject: [PATCH 10/19] Handle TimeoutError during HKC setup attempts (#80399) closes https://github.com/Jc2k/aiohomekit/issues/188 --- homeassistant/components/homekit_controller/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/homekit_controller/__init__.py b/homeassistant/components/homekit_controller/__init__.py index dac4afc0b22..54da6e71c8c 100644 --- a/homeassistant/components/homekit_controller/__init__.py +++ b/homeassistant/components/homekit_controller/__init__.py @@ -40,7 +40,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: try: await conn.async_setup() - except (AccessoryNotFoundError, EncryptionError, AccessoryDisconnectedError) as ex: + except ( + asyncio.TimeoutError, + AccessoryNotFoundError, + EncryptionError, + AccessoryDisconnectedError, + ) as ex: del hass.data[KNOWN_DEVICES][conn.unique_id] with contextlib.suppress(asyncio.TimeoutError): await conn.pairing.close() From 0c3d4f2e57c138d32a5e0bc826076f8928879684 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 15 Oct 2022 14:08:26 -1000 Subject: [PATCH 11/19] Bump aiohomekit to 2.0.2 (#80402) --- homeassistant/components/homekit_controller/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homekit_controller/manifest.json b/homeassistant/components/homekit_controller/manifest.json index 2f5f8911968..53ec03e5410 100644 --- a/homeassistant/components/homekit_controller/manifest.json +++ b/homeassistant/components/homekit_controller/manifest.json @@ -3,7 +3,7 @@ "name": "HomeKit Controller", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/homekit_controller", - "requirements": ["aiohomekit==2.0.1"], + "requirements": ["aiohomekit==2.0.2"], "zeroconf": ["_hap._tcp.local.", "_hap._udp.local."], "bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }], "dependencies": ["bluetooth", "zeroconf"], diff --git a/requirements_all.txt b/requirements_all.txt index de635d42499..1318b5adc1f 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -171,7 +171,7 @@ aioguardian==2022.07.0 aioharmony==0.2.9 # homeassistant.components.homekit_controller -aiohomekit==2.0.1 +aiohomekit==2.0.2 # homeassistant.components.emulated_hue # homeassistant.components.http diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ca26b35de93..2a0e52ae671 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -155,7 +155,7 @@ aioguardian==2022.07.0 aioharmony==0.2.9 # homeassistant.components.homekit_controller -aiohomekit==2.0.1 +aiohomekit==2.0.2 # homeassistant.components.emulated_hue # homeassistant.components.http From c76d0f18c8c9cbdc54447d72004c06df05f3a5f9 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 17 Oct 2022 16:54:37 -0400 Subject: [PATCH 12/19] Bump ZHA quirks to 0.0.83 (#80489) --- homeassistant/components/zha/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index 7067491a12a..5796fc99f3f 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -7,7 +7,7 @@ "bellows==0.34.2", "pyserial==3.5", "pyserial-asyncio==0.6", - "zha-quirks==0.0.82", + "zha-quirks==0.0.83", "zigpy-deconz==0.19.0", "zigpy==0.51.3", "zigpy-xbee==0.16.2", diff --git a/requirements_all.txt b/requirements_all.txt index 1318b5adc1f..4a3c0717113 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2592,7 +2592,7 @@ zengge==0.2 zeroconf==0.39.1 # homeassistant.components.zha -zha-quirks==0.0.82 +zha-quirks==0.0.83 # homeassistant.components.zhong_hong zhong_hong_hvac==1.0.9 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 2a0e52ae671..4fecba2bbc6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1793,7 +1793,7 @@ youless-api==0.16 zeroconf==0.39.1 # homeassistant.components.zha -zha-quirks==0.0.82 +zha-quirks==0.0.83 # homeassistant.components.zha zigpy-deconz==0.19.0 From 69a698d97a3bd6af7b311b40af4a3b5456cc08e8 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Tue, 18 Oct 2022 02:40:49 -0600 Subject: [PATCH 13/19] Don't add RainMachine restriction switches if underlying data is missing (#80502) --- homeassistant/components/rainmachine/switch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/rainmachine/switch.py b/homeassistant/components/rainmachine/switch.py index 56ac814e2eb..db560c3c64c 100644 --- a/homeassistant/components/rainmachine/switch.py +++ b/homeassistant/components/rainmachine/switch.py @@ -34,7 +34,7 @@ from .model import ( RainMachineEntityDescriptionMixinDataKey, RainMachineEntityDescriptionMixinUid, ) -from .util import RUN_STATE_MAP +from .util import RUN_STATE_MAP, key_exists ATTR_AREA = "area" ATTR_CS_ON = "cs_on" @@ -237,6 +237,8 @@ async def async_setup_entry( # Add switches to control restrictions: for description in RESTRICTIONS_SWITCH_DESCRIPTIONS: + if not key_exists(coordinator.data, description.data_key): + continue entities.append(RainMachineRestrictionSwitch(entry, data, description)) async_add_entities(entities) From 605abe58828aa979fd2d3957a9f7bee54fcaec63 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Thu, 20 Oct 2022 11:22:30 +0200 Subject: [PATCH 14/19] Add missed write state request for MQTT cover (#80540) Missed write state request for MQTT cover --- homeassistant/components/mqtt/cover.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/mqtt/cover.py b/homeassistant/components/mqtt/cover.py index 6ed12b8adef..11901f15054 100644 --- a/homeassistant/components/mqtt/cover.py +++ b/homeassistant/components/mqtt/cover.py @@ -767,6 +767,7 @@ class MqttCover(MqttEntity, CoverEntity): return position + @callback def tilt_payload_received(self, _payload): """Set the tilt value.""" @@ -784,7 +785,7 @@ class MqttCover(MqttEntity, CoverEntity): ): level = self.find_percentage_in_range(payload) self._tilt_value = level - self.async_write_ha_state() + get_mqtt_data(self.hass).state_write_requests.write_state_request(self) else: _LOGGER.warning( "Payload '%s' is out of range, must be between '%s' and '%s' inclusive", From 8378b768d0d7e9d6b78805fb0ca28c253740becf Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Tue, 18 Oct 2022 21:55:50 +0200 Subject: [PATCH 15/19] Save last target temperature in Shelly climate platform (#80561) Save last target temp --- homeassistant/components/shelly/climate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/shelly/climate.py b/homeassistant/components/shelly/climate.py index f98c048d569..e34530d1c8e 100644 --- a/homeassistant/components/shelly/climate.py +++ b/homeassistant/components/shelly/climate.py @@ -140,6 +140,7 @@ class BlockSleepingClimate( self.last_state: State | None = None self.last_state_attributes: Mapping[str, Any] self._preset_modes: list[str] = [] + self._last_target_temp = 20.0 if self.block is not None and self.device_block is not None: self._unique_id = f"{self.wrapper.mac}-{self.block.description}" @@ -266,9 +267,15 @@ class BlockSleepingClimate( async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set hvac mode.""" if hvac_mode == HVACMode.OFF: + if isinstance(self.target_temperature, float): + self._last_target_temp = self.target_temperature await self.set_state_full_path( target_t_enabled=1, target_t=f"{self._attr_min_temp}" ) + if hvac_mode == HVACMode.HEAT: + await self.set_state_full_path( + target_t_enabled=1, target_t=self._last_target_temp + ) async def async_set_preset_mode(self, preset_mode: str) -> None: """Set preset mode.""" From fb35896b164be72e4d31ba81bb0804c032b998ce Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Oct 2022 00:13:41 -0500 Subject: [PATCH 16/19] Bump bluetooth-auto-recovery to 0.3.6 (#80643) * Bump bluetooth-auto-recovery to 0.3.5 changelog: https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/compare/v0.3.4...v0.3.5 * bump again for more rfkill fixes --- homeassistant/components/bluetooth/manifest.json | 2 +- homeassistant/package_constraints.txt | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/bluetooth/manifest.json b/homeassistant/components/bluetooth/manifest.json index 783d4ce7df2..d829b46574d 100644 --- a/homeassistant/components/bluetooth/manifest.json +++ b/homeassistant/components/bluetooth/manifest.json @@ -9,7 +9,7 @@ "bleak==0.18.1", "bleak-retry-connector==2.1.3", "bluetooth-adapters==0.6.0", - "bluetooth-auto-recovery==0.3.4", + "bluetooth-auto-recovery==0.3.6", "dbus-fast==1.24.0" ], "codeowners": ["@bdraco"], diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 183a0205762..3f9168ee19f 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -13,7 +13,7 @@ bcrypt==3.1.7 bleak-retry-connector==2.1.3 bleak==0.18.1 bluetooth-adapters==0.6.0 -bluetooth-auto-recovery==0.3.4 +bluetooth-auto-recovery==0.3.6 certifi>=2021.5.30 ciso8601==2.2.0 cryptography==38.0.1 diff --git a/requirements_all.txt b/requirements_all.txt index 4a3c0717113..c869fcfa433 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -435,7 +435,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.6.0 # homeassistant.components.bluetooth -bluetooth-auto-recovery==0.3.4 +bluetooth-auto-recovery==0.3.6 # homeassistant.components.bond bond-async==0.1.22 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 4fecba2bbc6..0c03bd6ec60 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -349,7 +349,7 @@ bluemaestro-ble==0.2.0 bluetooth-adapters==0.6.0 # homeassistant.components.bluetooth -bluetooth-auto-recovery==0.3.4 +bluetooth-auto-recovery==0.3.6 # homeassistant.components.bond bond-async==0.1.22 From 799f7769563469288d6853d1709f9be0d153c134 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 20 Oct 2022 18:30:00 +0200 Subject: [PATCH 17/19] Pin uamqp==1.6.0 (#80678) --- homeassistant/package_constraints.txt | 3 +++ script/gen_requirements_all.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 3f9168ee19f..2793a383050 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -132,3 +132,6 @@ iso4217!=1.10.20220401 # Pandas 1.4.4 has issues with wheels om armhf + Py3.10 pandas==1.4.3 + +# uamqp 1.6.1, has 1 failing test during built on armv7/armhf +uamqp==1.6.0 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index d0eb830f088..3c2f92cf649 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -142,6 +142,9 @@ iso4217!=1.10.20220401 # Pandas 1.4.4 has issues with wheels om armhf + Py3.10 pandas==1.4.3 + +# uamqp 1.6.1, has 1 failing test during built on armv7/armhf +uamqp==1.6.0 """ IGNORE_PRE_COMMIT_HOOK_ID = ( From 44d35fc8e4a779f0e6902d593fc1fa61d3b65d91 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Oct 2022 13:35:38 -0500 Subject: [PATCH 18/19] Fix bluetooth calls from automations in esphome (#80683) --- homeassistant/components/bluetooth/models.py | 2 ++ homeassistant/components/esphome/bluetooth/client.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/bluetooth/models.py b/homeassistant/components/bluetooth/models.py index 9e93ea4d142..4ea44bcbe9b 100644 --- a/homeassistant/components/bluetooth/models.py +++ b/homeassistant/components/bluetooth/models.py @@ -279,6 +279,7 @@ class HaBleakClientWrapper(BleakClient): async def connect(self, **kwargs: Any) -> bool: """Connect to the specified GATT server.""" if not self._backend: + assert MANAGER is not None wrapped_backend = ( self._async_get_backend() or await self._async_get_fallback_backend() ) @@ -287,6 +288,7 @@ class HaBleakClientWrapper(BleakClient): or wrapped_backend.device, disconnected_callback=self.__disconnected_callback, timeout=self.__timeout, + hass=MANAGER.hass, ) return await super().connect(**kwargs) diff --git a/homeassistant/components/esphome/bluetooth/client.py b/homeassistant/components/esphome/bluetooth/client.py index 14924756074..eda75436502 100644 --- a/homeassistant/components/esphome/bluetooth/client.py +++ b/homeassistant/components/esphome/bluetooth/client.py @@ -15,7 +15,7 @@ from bleak.backends.device import BLEDevice from bleak.backends.service import BleakGATTServiceCollection from bleak.exc import BleakError -from homeassistant.core import CALLBACK_TYPE, async_get_hass +from homeassistant.core import CALLBACK_TYPE from ..domain_data import DomainData from .characteristic import BleakGATTCharacteristicESPHome @@ -83,7 +83,7 @@ class ESPHomeClient(BaseBleakClient): self._address_as_int = mac_to_int(self._ble_device.address) assert self._ble_device.details is not None self._source = self._ble_device.details["source"] - self.domain_data = DomainData.get(async_get_hass()) + self.domain_data = DomainData.get(kwargs["hass"]) config_entry = self.domain_data.get_by_unique_id(self._source) self.entry_data = self.domain_data.get_entry_data(config_entry) self._client = self.entry_data.client From c2dff8fb7e132f3cd692b23a86f2e4c58eab1cca Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 20 Oct 2022 14:49:21 -0400 Subject: [PATCH 19/19] Bumped version to 2022.10.5 --- homeassistant/const.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index b60ab0d17e9..da1e691903f 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -8,7 +8,7 @@ from .backports.enum import StrEnum APPLICATION_NAME: Final = "HomeAssistant" MAJOR_VERSION: Final = 2022 MINOR_VERSION: Final = 10 -PATCH_VERSION: Final = "4" +PATCH_VERSION: Final = "5" __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/pyproject.toml b/pyproject.toml index 9a6c1458742..5ea26ef1976 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2022.10.4" +version = "2022.10.5" license = {text = "Apache-2.0"} description = "Open-source home automation platform running on Python 3." readme = "README.rst"