From b22bcc568a87285938a2d207540144b21ce77562 Mon Sep 17 00:00:00 2001 From: Maarten Weyns Date: Fri, 9 Dec 2022 23:16:15 +0100 Subject: [PATCH 01/13] Bump pyrisco to 0.5.7 (#83548) --- homeassistant/components/risco/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/risco/manifest.json b/homeassistant/components/risco/manifest.json index d31d148f4da..c827718c4ff 100644 --- a/homeassistant/components/risco/manifest.json +++ b/homeassistant/components/risco/manifest.json @@ -3,7 +3,7 @@ "name": "Risco", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/risco", - "requirements": ["pyrisco==0.5.6"], + "requirements": ["pyrisco==0.5.7"], "codeowners": ["@OnFreund"], "quality_scale": "platinum", "iot_class": "local_push", diff --git a/requirements_all.txt b/requirements_all.txt index 9c5329d5072..97de678b1f9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1866,7 +1866,7 @@ pyrecswitch==1.0.2 pyrepetierng==0.1.0 # homeassistant.components.risco -pyrisco==0.5.6 +pyrisco==0.5.7 # homeassistant.components.rituals_perfume_genie pyrituals==0.0.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 97451c725df..a31a6eb3798 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1322,7 +1322,7 @@ pyps4-2ndscreen==1.3.1 pyqwikswitch==0.93 # homeassistant.components.risco -pyrisco==0.5.6 +pyrisco==0.5.7 # homeassistant.components.rituals_perfume_genie pyrituals==0.0.6 From 169b7c91c367abcc905746b747d70e2dc4012966 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 9 Dec 2022 20:33:00 +0100 Subject: [PATCH 02/13] Bump pychromecast to 13.0.2 (#83625) * Bump pychromecast to 13.0.2 * Pass hass UUID to HomeAssistantController --- homeassistant/components/cast/home_assistant_cast.py | 5 ++++- homeassistant/components/cast/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/cast/home_assistant_cast.py b/homeassistant/components/cast/home_assistant_cast.py index 010e4a046b4..dc15bc3440e 100644 --- a/homeassistant/components/cast/home_assistant_cast.py +++ b/homeassistant/components/cast/home_assistant_cast.py @@ -7,7 +7,7 @@ import voluptuous as vol from homeassistant import auth, config_entries, core from homeassistant.const import ATTR_ENTITY_ID from homeassistant.exceptions import HomeAssistantError -from homeassistant.helpers import config_validation as cv, dispatcher +from homeassistant.helpers import config_validation as cv, dispatcher, instance_id from homeassistant.helpers.network import NoURLAvailableError, get_url from homeassistant.helpers.service import async_register_admin_service @@ -49,10 +49,13 @@ async def async_setup_ha_cast( except NoURLAvailableError as err: raise HomeAssistantError(NO_URL_AVAILABLE_ERROR) from err + hass_uuid = await instance_id.async_get(hass) + controller = HomeAssistantController( # If you are developing Home Assistant Cast, uncomment and set to your dev app id. # app_id="5FE44367", hass_url=hass_url, + hass_uuid=hass_uuid, client_id=None, refresh_token=refresh_token.token, ) diff --git a/homeassistant/components/cast/manifest.json b/homeassistant/components/cast/manifest.json index c5dc56a7da0..00688f642ad 100644 --- a/homeassistant/components/cast/manifest.json +++ b/homeassistant/components/cast/manifest.json @@ -3,7 +3,7 @@ "name": "Google Cast", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/cast", - "requirements": ["pychromecast==13.0.1"], + "requirements": ["pychromecast==13.0.2"], "after_dependencies": [ "cloud", "http", diff --git a/requirements_all.txt b/requirements_all.txt index 97de678b1f9..f6f63561e53 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1504,7 +1504,7 @@ pycfdns==2.0.1 pychannels==1.2.3 # homeassistant.components.cast -pychromecast==13.0.1 +pychromecast==13.0.2 # homeassistant.components.pocketcasts pycketcasts==1.0.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a31a6eb3798..71969f10091 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1077,7 +1077,7 @@ pybravia==0.2.3 pycfdns==2.0.1 # homeassistant.components.cast -pychromecast==13.0.1 +pychromecast==13.0.2 # homeassistant.components.comfoconnect pycomfoconnect==0.4 From 77336427a4d0d7b90be3436ed5c5a1bdd667b65e Mon Sep 17 00:00:00 2001 From: rappenze Date: Sat, 10 Dec 2022 19:23:07 +0100 Subject: [PATCH 03/13] Fix fibaro climate unit (#83659) --- homeassistant/components/fibaro/climate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fibaro/climate.py b/homeassistant/components/fibaro/climate.py index 7731b2544c4..692a0781797 100644 --- a/homeassistant/components/fibaro/climate.py +++ b/homeassistant/components/fibaro/climate.py @@ -164,7 +164,8 @@ class FibaroThermostat(FibaroDevice, ClimateEntity): ): self._target_temp_device = FibaroDevice(device) self._attr_supported_features |= ClimateEntityFeature.TARGET_TEMPERATURE - tempunit = device.properties.unit + if "unit" in device.properties: + tempunit = device.properties.unit if any(action for action in OP_MODE_ACTIONS if action in device.actions): self._op_mode_device = FibaroDevice(device) From eb03307bce04b494b7b0380f8660e83ed4cf86d9 Mon Sep 17 00:00:00 2001 From: Christopher Bailey Date: Sun, 11 Dec 2022 10:32:26 -0800 Subject: [PATCH 04/13] Fix event sensor for UniFi Protect (#83663) * Fix event sensor for UniFi Protect * Linting * Adds no cover * Clean up check * Linting --- .../components/unifiprotect/sensor.py | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/unifiprotect/sensor.py b/homeassistant/components/unifiprotect/sensor.py index fa08892e2d3..25f8e814536 100644 --- a/homeassistant/components/unifiprotect/sensor.py +++ b/homeassistant/components/unifiprotect/sensor.py @@ -772,20 +772,29 @@ class ProtectEventSensor(EventEntityMixin, SensorEntity): def _async_update_device_from_protect(self, device: ProtectModelWithId) -> None: # do not call ProtectDeviceSensor method since we want event to get value here EventEntityMixin._async_update_device_from_protect(self, device) - if ( + is_on = self.entity_description.get_is_on(device) + is_license_plate = ( self.entity_description.ufp_smart_type == SmartDetectObjectType.LICENSE_PLATE + ) + if ( + not is_on + or self._event is None + or ( + is_license_plate + and ( + self._event.metadata is None + or self._event.metadata.license_plate is None + ) + ) ): - if ( - self._event is None - or self._event.metadata is None - or self._event.metadata.license_plate is None - ): - self._attr_native_value = OBJECT_TYPE_NONE - else: - self._attr_native_value = self._event.metadata.license_plate.name + self._attr_native_value = OBJECT_TYPE_NONE + self._event = None + self._attr_extra_state_attributes = {} + return + + if is_license_plate: + # type verified above + self._attr_native_value = self._event.metadata.license_plate.name # type: ignore[union-attr] else: - if self._event is None: - self._attr_native_value = OBJECT_TYPE_NONE - else: - self._attr_native_value = self._event.smart_detect_types[0].value + self._attr_native_value = self._event.smart_detect_types[0].value From 4c346697f08d71ca811e942e02f46ef4688fd5ee Mon Sep 17 00:00:00 2001 From: SukramJ Date: Sat, 10 Dec 2022 03:18:47 +0100 Subject: [PATCH 05/13] Add missing CONF_SPEED to sensor device_trigger SCHEMA (#83679) * Update device_trigger.py * add missing CONF_IS_SPEED to device_condition --- homeassistant/components/sensor/device_condition.py | 1 + homeassistant/components/sensor/device_trigger.py | 1 + 2 files changed, 2 insertions(+) diff --git a/homeassistant/components/sensor/device_condition.py b/homeassistant/components/sensor/device_condition.py index 34a2590ce8e..0e6a629a648 100644 --- a/homeassistant/components/sensor/device_condition.py +++ b/homeassistant/components/sensor/device_condition.py @@ -143,6 +143,7 @@ CONDITION_SCHEMA = vol.All( CONF_IS_PRESSURE, CONF_IS_REACTIVE_POWER, CONF_IS_SIGNAL_STRENGTH, + CONF_IS_SPEED, CONF_IS_SULPHUR_DIOXIDE, CONF_IS_TEMPERATURE, CONF_IS_VOLATILE_ORGANIC_COMPOUNDS, diff --git a/homeassistant/components/sensor/device_trigger.py b/homeassistant/components/sensor/device_trigger.py index c1b0699664e..2550afad2fc 100644 --- a/homeassistant/components/sensor/device_trigger.py +++ b/homeassistant/components/sensor/device_trigger.py @@ -143,6 +143,7 @@ TRIGGER_SCHEMA = vol.All( CONF_PRESSURE, CONF_REACTIVE_POWER, CONF_SIGNAL_STRENGTH, + CONF_SPEED, CONF_SULPHUR_DIOXIDE, CONF_TEMPERATURE, CONF_VOLATILE_ORGANIC_COMPOUNDS, From d8982116fbe0fc3a6604a95452c0f89e3b2d7008 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Fri, 9 Dec 2022 22:21:38 +0200 Subject: [PATCH 06/13] Bump aioshelly to 5.1.1 (#83680) --- homeassistant/components/shelly/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/shelly/manifest.json b/homeassistant/components/shelly/manifest.json index 7c2fe3beef6..aae3e0107b5 100644 --- a/homeassistant/components/shelly/manifest.json +++ b/homeassistant/components/shelly/manifest.json @@ -3,7 +3,7 @@ "name": "Shelly", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/shelly", - "requirements": ["aioshelly==5.1.0"], + "requirements": ["aioshelly==5.1.1"], "dependencies": ["bluetooth", "http"], "zeroconf": [ { diff --git a/requirements_all.txt b/requirements_all.txt index f6f63561e53..5c565e5b4de 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -261,7 +261,7 @@ aiosenseme==0.6.1 aiosenz==1.0.0 # homeassistant.components.shelly -aioshelly==5.1.0 +aioshelly==5.1.1 # homeassistant.components.skybell aioskybell==22.7.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 71969f10091..d25b85a4a56 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -236,7 +236,7 @@ aiosenseme==0.6.1 aiosenz==1.0.0 # homeassistant.components.shelly -aioshelly==5.1.0 +aioshelly==5.1.1 # homeassistant.components.skybell aioskybell==22.7.0 From 3a2fb402a4cdb5e4e2f83c4be3d5d58d60d70d19 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Dec 2022 15:55:06 -1000 Subject: [PATCH 07/13] Fix delay setting up new Yale Access Bluetooth entries (#83683) Entries took a while to setup because of the async_wait_init_flow_finish call in _async_setup_component The delay was so long that users thought the integration was broken We had a wait in place for advertisements to arrive during discovery in case the lock was not yet seen. Since integration discovery is deferred until after startup this wait it no longer needed --- .../components/yalexs_ble/config_flow.py | 12 +++---- homeassistant/components/yalexs_ble/util.py | 19 ---------- .../components/yalexs_ble/test_config_flow.py | 36 +++++++++---------- 3 files changed, 23 insertions(+), 44 deletions(-) diff --git a/homeassistant/components/yalexs_ble/config_flow.py b/homeassistant/components/yalexs_ble/config_flow.py index 5fee6f62848..7845e8aa5e8 100644 --- a/homeassistant/components/yalexs_ble/config_flow.py +++ b/homeassistant/components/yalexs_ble/config_flow.py @@ -1,7 +1,6 @@ """Config flow for Yale Access Bluetooth integration.""" from __future__ import annotations -import asyncio import logging from typing import Any @@ -27,7 +26,7 @@ from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.typing import DiscoveryInfoType from .const import CONF_KEY, CONF_LOCAL_NAME, CONF_SLOT, DOMAIN -from .util import async_get_service_info, human_readable_name +from .util import async_find_existing_service_info, human_readable_name _LOGGER = logging.getLogger(__name__) @@ -110,11 +109,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): ) raise AbortFlow(reason="already_configured") - try: - self._discovery_info = await async_get_service_info( - hass, local_name, address - ) - except asyncio.TimeoutError: + self._discovery_info = async_find_existing_service_info( + hass, local_name, address + ) + if not self._discovery_info: return self.async_abort(reason="no_devices_found") # Integration discovery should abort other flows unless they diff --git a/homeassistant/components/yalexs_ble/util.py b/homeassistant/components/yalexs_ble/util.py index 465f4487c0b..e361e141a42 100644 --- a/homeassistant/components/yalexs_ble/util.py +++ b/homeassistant/components/yalexs_ble/util.py @@ -6,10 +6,8 @@ import platform from yalexs_ble import local_name_is_unique from homeassistant.components.bluetooth import ( - BluetoothScanningMode, BluetoothServiceInfoBleak, async_discovered_service_info, - async_process_advertisements, ) from homeassistant.components.bluetooth.match import ( ADDRESS, @@ -18,8 +16,6 @@ from homeassistant.components.bluetooth.match import ( ) from homeassistant.core import HomeAssistant, callback -from .const import DEVICE_TIMEOUT - def bluetooth_callback_matcher( local_name: str, address: str @@ -51,21 +47,6 @@ def async_find_existing_service_info( return None -async def async_get_service_info( - hass: HomeAssistant, local_name: str, address: str -) -> BluetoothServiceInfoBleak: - """Wait for the service info for the given local_name and address.""" - if service_info := async_find_existing_service_info(hass, local_name, address): - return service_info - return await async_process_advertisements( - hass, - lambda service_info: True, - bluetooth_callback_matcher(local_name, address), - BluetoothScanningMode.ACTIVE, - DEVICE_TIMEOUT, - ) - - def short_address(address: str) -> str: """Convert a Bluetooth address to a short address.""" split_address = address.replace("-", ":").split(":") diff --git a/tests/components/yalexs_ble/test_config_flow.py b/tests/components/yalexs_ble/test_config_flow.py index 64a4e93eae2..7f9c1fdf948 100644 --- a/tests/components/yalexs_ble/test_config_flow.py +++ b/tests/components/yalexs_ble/test_config_flow.py @@ -400,8 +400,8 @@ async def test_bluetooth_step_success(hass: HomeAssistant) -> None: async def test_integration_discovery_success(hass: HomeAssistant) -> None: """Test integration discovery step success path.""" with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=YALE_ACCESS_LOCK_DISCOVERY_INFO, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[YALE_ACCESS_LOCK_DISCOVERY_INFO], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -443,8 +443,8 @@ async def test_integration_discovery_success(hass: HomeAssistant) -> None: async def test_integration_discovery_device_not_found(hass: HomeAssistant) -> None: """Test integration discovery when the device is not found.""" with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - side_effect=asyncio.TimeoutError, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -483,8 +483,8 @@ async def test_integration_discovery_takes_precedence_over_bluetooth( assert flows[0]["context"]["local_name"] == YALE_ACCESS_LOCK_DISCOVERY_INFO.name with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=YALE_ACCESS_LOCK_DISCOVERY_INFO, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[YALE_ACCESS_LOCK_DISCOVERY_INFO], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -558,8 +558,8 @@ async def test_integration_discovery_updates_key_unique_local_name( entry.add_to_hass(hass) with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=LOCK_DISCOVERY_INFO_UUID_ADDRESS, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[LOCK_DISCOVERY_INFO_UUID_ADDRESS], ), patch( "homeassistant.components.yalexs_ble.async_setup_entry", return_value=True, @@ -600,8 +600,8 @@ async def test_integration_discovery_updates_key_without_unique_local_name( entry.add_to_hass(hass) with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=LOCK_DISCOVERY_INFO_UUID_ADDRESS, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[LOCK_DISCOVERY_INFO_UUID_ADDRESS], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -649,8 +649,8 @@ async def test_integration_discovery_updates_key_duplicate_local_name( entry2.add_to_hass(hass) with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=LOCK_DISCOVERY_INFO_UUID_ADDRESS, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[LOCK_DISCOVERY_INFO_UUID_ADDRESS], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -695,8 +695,8 @@ async def test_integration_discovery_takes_precedence_over_bluetooth_uuid_addres assert flows[0]["context"]["local_name"] == LOCK_DISCOVERY_INFO_UUID_ADDRESS.name with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=LOCK_DISCOVERY_INFO_UUID_ADDRESS, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[LOCK_DISCOVERY_INFO_UUID_ADDRESS], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -775,8 +775,8 @@ async def test_integration_discovery_takes_precedence_over_bluetooth_non_unique_ assert flows[0]["context"]["local_name"] == OLD_FIRMWARE_LOCK_DISCOVERY_INFO.name with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=OLD_FIRMWARE_LOCK_DISCOVERY_INFO, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[OLD_FIRMWARE_LOCK_DISCOVERY_INFO], ): result = await hass.config_entries.flow.async_init( DOMAIN, @@ -851,8 +851,8 @@ async def test_user_is_setting_up_lock_and_discovery_happens_in_the_middle( await valdidate_started.wait() with patch( - "homeassistant.components.yalexs_ble.util.async_process_advertisements", - return_value=LOCK_DISCOVERY_INFO_UUID_ADDRESS, + "homeassistant.components.yalexs_ble.util.async_discovered_service_info", + return_value=[LOCK_DISCOVERY_INFO_UUID_ADDRESS], ): discovery_result = await hass.config_entries.flow.async_init( DOMAIN, From e1505339a51de8aa23274dbe2116c38b0082763f Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sat, 10 Dec 2022 02:54:22 +0100 Subject: [PATCH 08/13] Fix loading of Fritz!Smarthome issues on older Fritz!Box (#83688) * check if templates are available * add test --- .../components/fritzbox/coordinator.py | 21 ++++++++++++++----- tests/components/fritzbox/test_init.py | 17 ++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/fritzbox/coordinator.py b/homeassistant/components/fritzbox/coordinator.py index c16751c8c9f..6bc3bac623f 100644 --- a/homeassistant/components/fritzbox/coordinator.py +++ b/homeassistant/components/fritzbox/coordinator.py @@ -3,6 +3,7 @@ from __future__ import annotations from dataclasses import dataclass from datetime import timedelta +from xml.etree.ElementTree import ParseError from pyfritzhome import Fritzhome, FritzhomeDevice, LoginError from pyfritzhome.devicetypes import FritzhomeTemplate @@ -34,6 +35,13 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat self.entry = entry self.fritz: Fritzhome = hass.data[DOMAIN][self.entry.entry_id][CONF_CONNECTIONS] self.configuration_url = self.fritz.get_prefixed_host() + self.has_templates = True + try: + hass.async_add_executor_job(self.fritz.update_templates) + except ParseError: + LOGGER.info("Disable smarthome templates") + self.has_templates = False + super().__init__( hass, LOGGER, @@ -45,7 +53,8 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat """Update all fritzbox device data.""" try: self.fritz.update_devices() - self.fritz.update_templates() + if self.has_templates: + self.fritz.update_templates() except requests.exceptions.ConnectionError as ex: raise UpdateFailed from ex except requests.exceptions.HTTPError: @@ -55,7 +64,8 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat except LoginError as ex: raise ConfigEntryAuthFailed from ex self.fritz.update_devices() - self.fritz.update_templates() + if self.has_templates: + self.fritz.update_templates() devices = self.fritz.get_devices() device_data = {} @@ -75,10 +85,11 @@ class FritzboxDataUpdateCoordinator(DataUpdateCoordinator[FritzboxCoordinatorDat device_data[device.ain] = device - templates = self.fritz.get_templates() template_data = {} - for template in templates: - template_data[template.ain] = template + if self.has_templates: + templates = self.fritz.get_templates() + for template in templates: + template_data[template.ain] = template return FritzboxCoordinatorData(devices=device_data, templates=template_data) diff --git a/tests/components/fritzbox/test_init.py b/tests/components/fritzbox/test_init.py index d68d9e1679c..dbec8b4ec14 100644 --- a/tests/components/fritzbox/test_init.py +++ b/tests/components/fritzbox/test_init.py @@ -2,6 +2,7 @@ from __future__ import annotations from unittest.mock import Mock, call, patch +from xml.etree.ElementTree import ParseError from pyfritzhome import LoginError import pytest @@ -167,7 +168,7 @@ async def test_coordinator_update_after_reboot(hass: HomeAssistant, fritz: Mock) assert await hass.config_entries.async_setup(entry.entry_id) assert fritz().update_devices.call_count == 2 - assert fritz().update_templates.call_count == 1 + assert fritz().update_templates.call_count == 2 assert fritz().get_devices.call_count == 1 assert fritz().get_templates.call_count == 1 assert fritz().login.call_count == 2 @@ -265,3 +266,17 @@ async def test_raise_config_entry_not_ready_when_offline(hass: HomeAssistant): entries = hass.config_entries.async_entries() config_entry = entries[0] assert config_entry.state is ConfigEntryState.SETUP_ERROR + + +async def test_disable_smarthome_templates(hass: HomeAssistant, fritz: Mock): + """Test smarthome templates are disabled.""" + entry = MockConfigEntry( + domain=FB_DOMAIN, + data=MOCK_CONFIG[FB_DOMAIN][CONF_DEVICES][0], + unique_id="any", + ) + entry.add_to_hass(hass) + fritz().update_templates.side_effect = [ParseError(), ""] + + assert await hass.config_entries.async_setup(entry.entry_id) + assert fritz().update_templates.call_count == 1 From c169654bdf617b325544d5d7d777c7dd8cc49868 Mon Sep 17 00:00:00 2001 From: Kostas Chatzikokolakis Date: Sat, 10 Dec 2022 20:14:15 +0200 Subject: [PATCH 09/13] Bump androidtv dependency of androitv component (#83707) Fixes #80555 --- homeassistant/components/androidtv/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/androidtv/manifest.json b/homeassistant/components/androidtv/manifest.json index 6b1f5669345..a2883653869 100644 --- a/homeassistant/components/androidtv/manifest.json +++ b/homeassistant/components/androidtv/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/androidtv", "requirements": [ "adb-shell[async]==0.4.3", - "androidtv[async]==0.0.69", + "androidtv[async]==0.0.70", "pure-python-adb[async]==0.3.0.dev0" ], "codeowners": ["@JeffLIrion", "@ollo69"], diff --git a/requirements_all.txt b/requirements_all.txt index 5c565e5b4de..b461b644224 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -321,7 +321,7 @@ ambiclimate==0.2.1 amcrest==1.9.7 # homeassistant.components.androidtv -androidtv[async]==0.0.69 +androidtv[async]==0.0.70 # homeassistant.components.anel_pwrctrl anel_pwrctrl-homeassistant==0.0.1.dev2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d25b85a4a56..17073df8245 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -290,7 +290,7 @@ amberelectric==1.0.4 ambiclimate==0.2.1 # homeassistant.components.androidtv -androidtv[async]==0.0.69 +androidtv[async]==0.0.70 # homeassistant.components.anthemav anthemav==1.4.1 From 00655ef21c7cb4c3c7cfa44eb4f347b4a09f0a52 Mon Sep 17 00:00:00 2001 From: Avi Miller Date: Sun, 11 Dec 2022 12:03:13 +1100 Subject: [PATCH 10/13] lifx: bump aiolifx_effects dependency to v0.3.1 (#83730) Fixes #83719 Signed-off-by: Avi Miller Signed-off-by: Avi Miller --- homeassistant/components/lifx/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lifx/manifest.json b/homeassistant/components/lifx/manifest.json index c1e7cc56915..8adbd18f264 100644 --- a/homeassistant/components/lifx/manifest.json +++ b/homeassistant/components/lifx/manifest.json @@ -5,7 +5,7 @@ "documentation": "https://www.home-assistant.io/integrations/lifx", "requirements": [ "aiolifx==0.8.7", - "aiolifx_effects==0.3.0", + "aiolifx_effects==0.3.1", "aiolifx_themes==0.2.0" ], "quality_scale": "platinum", diff --git a/requirements_all.txt b/requirements_all.txt index b461b644224..802db40dfd5 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -196,7 +196,7 @@ aiokef==0.2.16 aiolifx==0.8.7 # homeassistant.components.lifx -aiolifx_effects==0.3.0 +aiolifx_effects==0.3.1 # homeassistant.components.lifx aiolifx_themes==0.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 17073df8245..0fd60298193 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -174,7 +174,7 @@ aiokafka==0.7.2 aiolifx==0.8.7 # homeassistant.components.lifx -aiolifx_effects==0.3.0 +aiolifx_effects==0.3.1 # homeassistant.components.lifx aiolifx_themes==0.2.0 From c9611303d54f378eea74717293bda56dfcc45953 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sun, 11 Dec 2022 19:22:54 +0100 Subject: [PATCH 11/13] Fix IPv6 sensor is only loaded when Fritz!Box is in router mode (#83757) do not check ipv6 when device is not a router --- homeassistant/components/fritz/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/fritz/common.py b/homeassistant/components/fritz/common.py index 5af4f0c2239..14e0f154374 100644 --- a/homeassistant/components/fritz/common.py +++ b/homeassistant/components/fritz/common.py @@ -669,6 +669,9 @@ class AvmWrapper(FritzBoxTools): def wrap_external_ipv6() -> str: return str(self.fritz_status.external_ipv6) + if not self.device_is_router: + return False + return bool(await self.hass.async_add_executor_job(wrap_external_ipv6)) async def async_get_connection_info(self) -> ConnectionInfo: From 3838c2ab6224d997c7dba2a74d26bcb1276de7af Mon Sep 17 00:00:00 2001 From: G Johansson Date: Sun, 11 Dec 2022 19:19:04 +0100 Subject: [PATCH 12/13] Fix scan_interval in Scrape (#83758) Scrape fix scan_interval --- homeassistant/components/scrape/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/scrape/__init__.py b/homeassistant/components/scrape/__init__.py index cb5657a9649..8953d9facd0 100644 --- a/homeassistant/components/scrape/__init__.py +++ b/homeassistant/components/scrape/__init__.py @@ -61,7 +61,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: load_coroutines: list[Coroutine[Any, Any, None]] = [] for resource_config in scrape_config: rest = create_rest_data_from_config(hass, resource_config) - scan_interval: timedelta = config.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL) + scan_interval: timedelta = resource_config.get( + CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL + ) coordinator = ScrapeCoordinator(hass, rest, scan_interval) sensors: list[ConfigType] = resource_config.get(SENSOR_DOMAIN, []) From d61be9a0eb0ca94e4f93541578c859c4132dcc37 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 11 Dec 2022 13:55:31 -0500 Subject: [PATCH 13/13] Bumped version to 2022.12.2 --- 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 3c96f48f6be..a073c1d1b10 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 = 12 -PATCH_VERSION: Final = "1" +PATCH_VERSION: Final = "2" __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 a1ae9d9c89a..b4de72935a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2022.12.1" +version = "2022.12.2" license = {text = "Apache-2.0"} description = "Open-source home automation platform running on Python 3." readme = "README.rst"