From bf5633fa433041ff4ba1dfdf02e8bb6890c1e028 Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Tue, 5 Jul 2022 18:54:03 +0200 Subject: [PATCH 01/18] Bump deCONZ dependency to v96 (#74460) --- homeassistant/components/deconz/light.py | 6 +----- homeassistant/components/deconz/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/deconz/light.py b/homeassistant/components/deconz/light.py index 669800e2662..7f3a47d719d 100644 --- a/homeassistant/components/deconz/light.py +++ b/homeassistant/components/deconz/light.py @@ -113,11 +113,7 @@ async def async_setup_entry( first = True for light_id in group.lights: - if ( - (light := gateway.api.lights.lights.get(light_id)) - and light.ZHATYPE == Light.ZHATYPE - and light.reachable - ): + if (light := gateway.api.lights.lights.get(light_id)) and light.reachable: group.update_color_state(light, update_all_attributes=first) first = False diff --git a/homeassistant/components/deconz/manifest.json b/homeassistant/components/deconz/manifest.json index 09dcc190a4f..c19d75ec054 100644 --- a/homeassistant/components/deconz/manifest.json +++ b/homeassistant/components/deconz/manifest.json @@ -3,7 +3,7 @@ "name": "deCONZ", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/deconz", - "requirements": ["pydeconz==95"], + "requirements": ["pydeconz==96"], "ssdp": [ { "manufacturer": "Royal Philips Electronics", diff --git a/requirements_all.txt b/requirements_all.txt index 99be85cc418..c561730dda7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1444,7 +1444,7 @@ pydaikin==2.7.0 pydanfossair==0.1.0 # homeassistant.components.deconz -pydeconz==95 +pydeconz==96 # homeassistant.components.delijn pydelijn==1.0.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b6a493d37f9..7ae59c713b3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -974,7 +974,7 @@ pycoolmasternet-async==0.1.2 pydaikin==2.7.0 # homeassistant.components.deconz -pydeconz==95 +pydeconz==96 # homeassistant.components.dexcom pydexcom==0.2.3 From fa220c5c25341de0c110c51489a91ce8e84a8871 Mon Sep 17 00:00:00 2001 From: c-soft Date: Thu, 7 Jul 2022 02:02:08 +0200 Subject: [PATCH 02/18] Bump satel_integra to 0.3.7 to fix compat with python 3.10 (#74543) --- homeassistant/components/satel_integra/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/satel_integra/manifest.json b/homeassistant/components/satel_integra/manifest.json index 6c4a391698b..262507be6bb 100644 --- a/homeassistant/components/satel_integra/manifest.json +++ b/homeassistant/components/satel_integra/manifest.json @@ -2,7 +2,7 @@ "domain": "satel_integra", "name": "Satel Integra", "documentation": "https://www.home-assistant.io/integrations/satel_integra", - "requirements": ["satel_integra==0.3.4"], + "requirements": ["satel_integra==0.3.7"], "codeowners": [], "iot_class": "local_push", "loggers": ["satel_integra"] diff --git a/requirements_all.txt b/requirements_all.txt index c561730dda7..f5d2fec04a1 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2125,7 +2125,7 @@ samsungctl[websocket]==0.7.1 samsungtvws[async,encrypted]==2.5.0 # homeassistant.components.satel_integra -satel_integra==0.3.4 +satel_integra==0.3.7 # homeassistant.components.dhcp scapy==2.4.5 From 414ea6fd8cbd06b6b2a2d18edaa8976780a3952c Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 7 Jul 2022 08:40:10 +0200 Subject: [PATCH 03/18] fjaraskupan: Make sure we stop bleak on home assistant stop (#74545) * Make sure we stop bleak on home assistant stop * Fix typing Co-authored-by: Martin Hjelmare --- homeassistant/components/fjaraskupan/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/fjaraskupan/__init__.py b/homeassistant/components/fjaraskupan/__init__.py index 4c4f19403a6..85e95db5513 100644 --- a/homeassistant/components/fjaraskupan/__init__.py +++ b/homeassistant/components/fjaraskupan/__init__.py @@ -12,8 +12,8 @@ from bleak.backends.scanner import AdvertisementData from fjaraskupan import Device, State, device_filter from homeassistant.config_entries import ConfigEntry -from homeassistant.const import Platform -from homeassistant.core import HomeAssistant, callback +from homeassistant.const import EVENT_HOMEASSISTANT_STOP, Platform +from homeassistant.core import Event, HomeAssistant, callback from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, async_dispatcher_send, @@ -131,6 +131,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: scanner.register_detection_callback(detection_callback) await scanner.start() + async def on_hass_stop(event: Event) -> None: + await scanner.stop() + + entry.async_on_unload( + hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop) + ) + hass.config_entries.async_setup_platforms(entry, PLATFORMS) return True From f6a23492fa9c276af15def2bb0ef35549c7c7c90 Mon Sep 17 00:00:00 2001 From: jjlawren Date: Thu, 7 Jul 2022 02:43:10 -0500 Subject: [PATCH 04/18] Minimize Sonos `media_player.unjoin` timeout (#74549) --- homeassistant/components/sonos/media_player.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index c68110d9763..470386c341d 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -69,6 +69,7 @@ from .speaker import SonosMedia, SonosSpeaker _LOGGER = logging.getLogger(__name__) LONG_SERVICE_TIMEOUT = 30.0 +UNJOIN_SERVICE_TIMEOUT = 0.1 VOLUME_INCREMENT = 2 REPEAT_TO_SONOS = { @@ -775,7 +776,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity): async def async_unjoin_player(self): """Remove this player from any group. - Coalesces all calls within 0.5s to allow use of SonosSpeaker.unjoin_multi() + Coalesces all calls within UNJOIN_SERVICE_TIMEOUT to allow use of SonosSpeaker.unjoin_multi() which optimizes the order in which speakers are removed from their groups. Removing coordinators last better preserves playqueues on the speakers. """ @@ -785,6 +786,9 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity): async def async_process_unjoin(now: datetime.datetime) -> None: """Process the unjoin with all remove requests within the coalescing period.""" unjoin_data = sonos_data.unjoin_data.pop(household_id) + _LOGGER.debug( + "Processing unjoins for %s", [x.zone_name for x in unjoin_data.speakers] + ) await SonosSpeaker.unjoin_multi(self.hass, unjoin_data.speakers) unjoin_data.event.set() @@ -794,6 +798,7 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity): unjoin_data = sonos_data.unjoin_data[household_id] = UnjoinData( speakers=[self.speaker] ) - async_call_later(self.hass, 0.5, async_process_unjoin) + async_call_later(self.hass, UNJOIN_SERVICE_TIMEOUT, async_process_unjoin) + _LOGGER.debug("Requesting unjoin for %s", self.speaker.zone_name) await unjoin_data.event.wait() From 606a1b57e6b73430437170a816e4024db74da7e6 Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Thu, 7 Jul 2022 03:39:37 -0400 Subject: [PATCH 05/18] Bump aioskybell to 22.7.0 (#74559) --- homeassistant/components/skybell/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/skybell/manifest.json b/homeassistant/components/skybell/manifest.json index c0e66aa5462..bfef4bc3422 100644 --- a/homeassistant/components/skybell/manifest.json +++ b/homeassistant/components/skybell/manifest.json @@ -3,7 +3,7 @@ "name": "SkyBell", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/skybell", - "requirements": ["aioskybell==22.6.1"], + "requirements": ["aioskybell==22.7.0"], "dependencies": ["ffmpeg"], "codeowners": ["@tkdrob"], "iot_class": "cloud_polling", diff --git a/requirements_all.txt b/requirements_all.txt index f5d2fec04a1..df719620b2a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -247,7 +247,7 @@ aiosenz==1.0.0 aioshelly==2.0.0 # homeassistant.components.skybell -aioskybell==22.6.1 +aioskybell==22.7.0 # homeassistant.components.slimproto aioslimproto==2.1.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7ae59c713b3..8d25e383315 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -216,7 +216,7 @@ aiosenz==1.0.0 aioshelly==2.0.0 # homeassistant.components.skybell -aioskybell==22.6.1 +aioskybell==22.7.0 # homeassistant.components.slimproto aioslimproto==2.1.1 From c9a31aab153c0d274ae1c2f47e45f447069b1068 Mon Sep 17 00:00:00 2001 From: ufodone <35497351+ufodone@users.noreply.github.com> Date: Thu, 7 Jul 2022 00:33:32 -0700 Subject: [PATCH 06/18] Bump pyenvisalink version to 4.6 (#74561) --- homeassistant/components/envisalink/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/envisalink/manifest.json b/homeassistant/components/envisalink/manifest.json index 44a40991a37..8d0fc735b90 100644 --- a/homeassistant/components/envisalink/manifest.json +++ b/homeassistant/components/envisalink/manifest.json @@ -2,7 +2,7 @@ "domain": "envisalink", "name": "Envisalink", "documentation": "https://www.home-assistant.io/integrations/envisalink", - "requirements": ["pyenvisalink==4.5"], + "requirements": ["pyenvisalink==4.6"], "codeowners": ["@ufodone"], "iot_class": "local_push", "loggers": ["pyenvisalink"] diff --git a/requirements_all.txt b/requirements_all.txt index df719620b2a..3ec631efb67 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1477,7 +1477,7 @@ pyeight==0.3.0 pyemby==1.8 # homeassistant.components.envisalink -pyenvisalink==4.5 +pyenvisalink==4.6 # homeassistant.components.ephember pyephember==0.3.1 From 174837dddfc3c8700f441e95241233a60351092e Mon Sep 17 00:00:00 2001 From: Glenn Waters Date: Thu, 7 Jul 2022 13:07:05 -0400 Subject: [PATCH 07/18] ElkM1 bump lib to support Python 3.10 SSL (#74569) Co-authored-by: J. Nick Koston --- homeassistant/components/elkm1/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/elkm1/manifest.json b/homeassistant/components/elkm1/manifest.json index 13f8ba8401f..7043fdfcb9d 100644 --- a/homeassistant/components/elkm1/manifest.json +++ b/homeassistant/components/elkm1/manifest.json @@ -2,7 +2,7 @@ "domain": "elkm1", "name": "Elk-M1 Control", "documentation": "https://www.home-assistant.io/integrations/elkm1", - "requirements": ["elkm1-lib==2.0.0"], + "requirements": ["elkm1-lib==2.0.2"], "dhcp": [{ "registered_devices": true }, { "macaddress": "00409D*" }], "codeowners": ["@gwww", "@bdraco"], "dependencies": ["network"], diff --git a/requirements_all.txt b/requirements_all.txt index 3ec631efb67..8844b7e2464 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -586,7 +586,7 @@ elgato==3.0.0 eliqonline==1.2.2 # homeassistant.components.elkm1 -elkm1-lib==2.0.0 +elkm1-lib==2.0.2 # homeassistant.components.elmax elmax_api==0.0.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 8d25e383315..737550785d9 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -426,7 +426,7 @@ eagle100==0.1.1 elgato==3.0.0 # homeassistant.components.elkm1 -elkm1-lib==2.0.0 +elkm1-lib==2.0.2 # homeassistant.components.elmax elmax_api==0.0.2 From fdc1b6ea9e8bd7decb6b23b8ed1813a23509f7ec Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 7 Jul 2022 09:03:43 +0200 Subject: [PATCH 08/18] Fix openweathermap hourly forecast (#74578) --- homeassistant/components/openweathermap/weather.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/openweathermap/weather.py b/homeassistant/components/openweathermap/weather.py index ea439a35586..9948ecc0428 100644 --- a/homeassistant/components/openweathermap/weather.py +++ b/homeassistant/components/openweathermap/weather.py @@ -143,7 +143,11 @@ class OpenWeatherMapWeather(WeatherEntity): """Return the forecast array.""" api_forecasts = self._weather_coordinator.data[ATTR_API_FORECAST] forecasts = [ - {ha_key: forecast[api_key] for api_key, ha_key in FORECAST_MAP.items()} + { + ha_key: forecast[api_key] + for api_key, ha_key in FORECAST_MAP.items() + if api_key in forecast + } for forecast in api_forecasts ] return cast(list[Forecast], forecasts) From 9514b0f1000079c4ea2181b14324d77c3455b4ea Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 7 Jul 2022 12:27:25 +0200 Subject: [PATCH 09/18] Fix mix of aiohttp and requests in Bloomsky (#74598) --- homeassistant/components/bloomsky/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/bloomsky/__init__.py b/homeassistant/components/bloomsky/__init__.py index 8311f6cbd96..ed2ce1ebc70 100644 --- a/homeassistant/components/bloomsky/__init__.py +++ b/homeassistant/components/bloomsky/__init__.py @@ -3,7 +3,6 @@ from datetime import timedelta from http import HTTPStatus import logging -from aiohttp.hdrs import AUTHORIZATION import requests import voluptuous as vol @@ -67,7 +66,7 @@ class BloomSky: _LOGGER.debug("Fetching BloomSky update") response = requests.get( f"{self.API_URL}?{self._endpoint_argument}", - headers={AUTHORIZATION: self._api_key}, + headers={"Authorization": self._api_key}, timeout=10, ) if response.status_code == HTTPStatus.UNAUTHORIZED: From 5a7e506c3844774e7fbaaf8b6e60be404c75243f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 7 Jul 2022 16:02:36 +0200 Subject: [PATCH 10/18] Update aiokafka to 0.7.2 (#74601) --- homeassistant/components/apache_kafka/__init__.py | 1 - homeassistant/components/apache_kafka/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/apache_kafka/__init__.py b/homeassistant/components/apache_kafka/__init__.py index 1b293bd2c04..38a70b450ab 100644 --- a/homeassistant/components/apache_kafka/__init__.py +++ b/homeassistant/components/apache_kafka/__init__.py @@ -102,7 +102,6 @@ class KafkaManager: self._hass = hass ssl_context = ssl_util.client_context() self._producer = AIOKafkaProducer( - loop=hass.loop, bootstrap_servers=f"{ip_address}:{port}", compression_type="gzip", security_protocol=security_protocol, diff --git a/homeassistant/components/apache_kafka/manifest.json b/homeassistant/components/apache_kafka/manifest.json index 3b290146a09..3fa1f70c57b 100644 --- a/homeassistant/components/apache_kafka/manifest.json +++ b/homeassistant/components/apache_kafka/manifest.json @@ -2,7 +2,7 @@ "domain": "apache_kafka", "name": "Apache Kafka", "documentation": "https://www.home-assistant.io/integrations/apache_kafka", - "requirements": ["aiokafka==0.6.0"], + "requirements": ["aiokafka==0.7.2"], "codeowners": ["@bachya"], "iot_class": "local_push", "loggers": ["aiokafka", "kafka_python"] diff --git a/requirements_all.txt b/requirements_all.txt index 8844b7e2464..ea5bd8cca1e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -181,7 +181,7 @@ aiohue==4.4.2 aioimaplib==1.0.0 # homeassistant.components.apache_kafka -aiokafka==0.6.0 +aiokafka==0.7.2 # homeassistant.components.kef aiokef==0.2.16 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 737550785d9..3cbc10480bb 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -162,7 +162,7 @@ aiohttp_cors==0.7.0 aiohue==4.4.2 # homeassistant.components.apache_kafka -aiokafka==0.6.0 +aiokafka==0.7.2 # homeassistant.components.lookin aiolookin==0.1.1 From ed6a65156c50a195bb0b7caceab3f7b227f0f116 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 7 Jul 2022 14:51:16 +0200 Subject: [PATCH 11/18] Poll cast groups when media player is added or reconnected (#74610) --- homeassistant/components/cast/helpers.py | 2 +- homeassistant/components/cast/media_player.py | 13 ++++ tests/components/cast/test_media_player.py | 75 +++++++++++++++++++ 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/cast/helpers.py b/homeassistant/components/cast/helpers.py index d7419f69563..48f57c39bd5 100644 --- a/homeassistant/components/cast/helpers.py +++ b/homeassistant/components/cast/helpers.py @@ -37,7 +37,7 @@ class ChromecastInfo: @property def friendly_name(self) -> str: - """Return the UUID.""" + """Return the Friendly Name.""" return self.cast_info.friendly_name @property diff --git a/homeassistant/components/cast/media_player.py b/homeassistant/components/cast/media_player.py index 958c53ae394..c8a6a82571e 100644 --- a/homeassistant/components/cast/media_player.py +++ b/homeassistant/components/cast/media_player.py @@ -441,6 +441,19 @@ class CastMediaPlayerEntity(CastDevice, MediaPlayerEntity): connection_status.status, ) self._attr_available = new_available + if new_available and not self._cast_info.is_audio_group: + # Poll current group status + for group_uuid in self.mz_mgr.get_multizone_memberships( + self._cast_info.uuid + ): + group_media_controller = self.mz_mgr.get_multizone_mediacontroller( + group_uuid + ) + if not group_media_controller: + continue + self.multizone_new_media_status( + group_uuid, group_media_controller.status + ) self.schedule_update_ha_state() def multizone_new_media_status(self, group_uuid, media_status): diff --git a/tests/components/cast/test_media_player.py b/tests/components/cast/test_media_player.py index 00626cc8c16..ed575c0fa22 100644 --- a/tests/components/cast/test_media_player.py +++ b/tests/components/cast/test_media_player.py @@ -731,6 +731,20 @@ async def test_entity_availability(hass: HomeAssistant): state = hass.states.get(entity_id) assert state.state == "off" + connection_status = MagicMock() + connection_status.status = "LOST" + conn_status_cb(connection_status) + await hass.async_block_till_done() + state = hass.states.get(entity_id) + assert state.state == "unavailable" + + connection_status = MagicMock() + connection_status.status = "CONNECTED" + conn_status_cb(connection_status) + await hass.async_block_till_done() + state = hass.states.get(entity_id) + assert state.state == "off" + connection_status = MagicMock() connection_status.status = "DISCONNECTED" conn_status_cb(connection_status) @@ -738,6 +752,14 @@ async def test_entity_availability(hass: HomeAssistant): state = hass.states.get(entity_id) assert state.state == "unavailable" + # Can't reconnect after receiving DISCONNECTED + connection_status = MagicMock() + connection_status.status = "CONNECTED" + conn_status_cb(connection_status) + await hass.async_block_till_done() + state = hass.states.get(entity_id) + assert state.state == "unavailable" + @pytest.mark.parametrize("port,entry_type", ((8009, None), (12345, None))) async def test_device_registry(hass: HomeAssistant, hass_ws_client, port, entry_type): @@ -1675,6 +1697,59 @@ async def test_group_media_states(hass, mz_mock): assert state.state == "playing" +async def test_group_media_states_early(hass, mz_mock): + """Test media states are read from group if entity has no state. + + This tests case asserts group state is polled when the player is created. + """ + entity_id = "media_player.speaker" + reg = er.async_get(hass) + + info = get_fake_chromecast_info() + + mz_mock.get_multizone_memberships = MagicMock(return_value=[str(FakeGroupUUID)]) + mz_mock.get_multizone_mediacontroller = MagicMock( + return_value=MagicMock(status=MagicMock(images=None, player_state="BUFFERING")) + ) + + chromecast, _ = await async_setup_media_player_cast(hass, info) + _, conn_status_cb, _, _ = get_status_callbacks(chromecast, mz_mock) + + state = hass.states.get(entity_id) + assert state is not None + assert state.name == "Speaker" + assert state.state == "unavailable" + assert entity_id == reg.async_get_entity_id("media_player", "cast", str(info.uuid)) + + # Check group state is polled when player is first created + connection_status = MagicMock() + connection_status.status = "CONNECTED" + conn_status_cb(connection_status) + await hass.async_block_till_done() + + assert hass.states.get(entity_id).state == "buffering" + + connection_status = MagicMock() + connection_status.status = "LOST" + conn_status_cb(connection_status) + await hass.async_block_till_done() + + assert hass.states.get(entity_id).state == "unavailable" + + # Check group state is polled when player reconnects + mz_mock.get_multizone_mediacontroller = MagicMock( + return_value=MagicMock(status=MagicMock(images=None, player_state="PLAYING")) + ) + + connection_status = MagicMock() + connection_status.status = "CONNECTED" + conn_status_cb(connection_status) + await hass.async_block_till_done() + await hass.async_block_till_done() + + assert hass.states.get(entity_id).state == "playing" + + async def test_group_media_control(hass, mz_mock, quick_play_mock): """Test media controls are handled by group if entity has no state.""" entity_id = "media_player.speaker" From 8b01c132c1c441c615ad8ddec11d5e15bab74720 Mon Sep 17 00:00:00 2001 From: Arne Mauer Date: Thu, 7 Jul 2022 20:28:33 +0200 Subject: [PATCH 12/18] Ikea Starkvind support all models (#74615) * Add Particulate Matter 2.5 of ZCL concentration clusters to ZHA component * Fixed black and flake8 test * New sensors and manufacturer cluster to support IKEA STARKVIND (with quirk) * Fix multi_match for FilterLifeTime, device_run_time, filter_run_time sensors for Ikea starkvind * Remove model match because sensors are matched with manufacturer channel * Update manufacturerspecific.py * Update number.py --- homeassistant/components/zha/binary_sensor.py | 2 +- homeassistant/components/zha/number.py | 4 +--- homeassistant/components/zha/sensor.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/zha/binary_sensor.py b/homeassistant/components/zha/binary_sensor.py index 709515d7ca2..23d26e4b13f 100644 --- a/homeassistant/components/zha/binary_sensor.py +++ b/homeassistant/components/zha/binary_sensor.py @@ -188,7 +188,7 @@ class FrostLock(BinarySensor, id_suffix="frost_lock"): _attr_device_class: BinarySensorDeviceClass = BinarySensorDeviceClass.LOCK -@MULTI_MATCH(channel_names="ikea_airpurifier", models={"STARKVIND Air purifier"}) +@MULTI_MATCH(channel_names="ikea_airpurifier") class ReplaceFilter(BinarySensor, id_suffix="replace_filter"): """ZHA BinarySensor.""" diff --git a/homeassistant/components/zha/number.py b/homeassistant/components/zha/number.py index e1268e29190..36fc5267bd9 100644 --- a/homeassistant/components/zha/number.py +++ b/homeassistant/components/zha/number.py @@ -525,9 +525,7 @@ class TimerDurationMinutes(ZHANumberConfigurationEntity, id_suffix="timer_durati _zcl_attribute: str = "timer_duration" -@CONFIG_DIAGNOSTIC_MATCH( - channel_names="ikea_airpurifier", models={"STARKVIND Air purifier"} -) +@CONFIG_DIAGNOSTIC_MATCH(channel_names="ikea_airpurifier") class FilterLifeTime(ZHANumberConfigurationEntity, id_suffix="filter_life_time"): """Representation of a ZHA timer duration configuration entity.""" diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index 4a4700b3c4c..c08c3f21201 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -810,7 +810,7 @@ class TimeLeft(Sensor, id_suffix="time_left"): _unit = TIME_MINUTES -@MULTI_MATCH(channel_names="ikea_airpurifier", models={"STARKVIND Air purifier"}) +@MULTI_MATCH(channel_names="ikea_airpurifier") class IkeaDeviceRunTime(Sensor, id_suffix="device_run_time"): """Sensor that displays device run time (in minutes).""" @@ -820,7 +820,7 @@ class IkeaDeviceRunTime(Sensor, id_suffix="device_run_time"): _unit = TIME_MINUTES -@MULTI_MATCH(channel_names="ikea_airpurifier", models={"STARKVIND Air purifier"}) +@MULTI_MATCH(channel_names="ikea_airpurifier") class IkeaFilterRunTime(Sensor, id_suffix="filter_run_time"): """Sensor that displays run time of the current filter (in minutes).""" From cd7f2eb73e97dd69c160bd28ae47629c3c2f706b Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 7 Jul 2022 16:19:56 +0200 Subject: [PATCH 13/18] Update frontend to 20220707.0 (#74625) --- homeassistant/components/frontend/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/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 85ead380485..5c7fd1a20be 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -2,7 +2,7 @@ "domain": "frontend", "name": "Home Assistant Frontend", "documentation": "https://www.home-assistant.io/integrations/frontend", - "requirements": ["home-assistant-frontend==20220706.0"], + "requirements": ["home-assistant-frontend==20220707.0"], "dependencies": [ "api", "auth", diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index c291d969219..de9df889eba 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -15,7 +15,7 @@ ciso8601==2.2.0 cryptography==36.0.2 fnvhash==0.1.0 hass-nabucasa==0.54.0 -home-assistant-frontend==20220706.0 +home-assistant-frontend==20220707.0 httpx==0.23.0 ifaddr==0.1.7 jinja2==3.1.2 diff --git a/requirements_all.txt b/requirements_all.txt index ea5bd8cca1e..8578c571fbb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -828,7 +828,7 @@ hole==0.7.0 holidays==0.14.2 # homeassistant.components.frontend -home-assistant-frontend==20220706.0 +home-assistant-frontend==20220707.0 # homeassistant.components.home_connect homeconnect==0.7.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3cbc10480bb..89b53d2b583 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -595,7 +595,7 @@ hole==0.7.0 holidays==0.14.2 # homeassistant.components.frontend -home-assistant-frontend==20220706.0 +home-assistant-frontend==20220707.0 # homeassistant.components.home_connect homeconnect==0.7.1 From 0da09ba47ec59afc814d5853a2c3c140f17ddec5 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 7 Jul 2022 16:59:49 +0200 Subject: [PATCH 14/18] Fix mix of aiohttp and requests in ZAMG (#74628) --- homeassistant/components/zamg/sensor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/zamg/sensor.py b/homeassistant/components/zamg/sensor.py index 87a1175b7cd..c32aa942625 100644 --- a/homeassistant/components/zamg/sensor.py +++ b/homeassistant/components/zamg/sensor.py @@ -10,7 +10,6 @@ import logging import os from typing import Union -from aiohttp.hdrs import USER_AGENT import requests import voluptuous as vol @@ -275,7 +274,7 @@ class ZamgData: """The class for handling the data retrieval.""" API_URL = "http://www.zamg.ac.at/ogd/" - API_HEADERS = {USER_AGENT: f"home-assistant.zamg/ {__version__}"} + API_HEADERS = {"User-Agent": f"home-assistant.zamg/ {__version__}"} def __init__(self, station_id): """Initialize the probe.""" From bac9af50df9004cc7bb6c16802722cb697889068 Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Thu, 7 Jul 2022 20:27:48 +0200 Subject: [PATCH 15/18] Fix smart energy polling for Tuya plugs (#74640) * Add PolledSmartEnergySummation to poll summation_delivered for some ZHA plugs * Remove PolledSmartEnergyMetering, add stop_on_match_group to summation sensors --- homeassistant/components/zha/sensor.py | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index c08c3f21201..513ba5510b5 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -472,25 +472,8 @@ class SmartEnergyMetering(Sensor): @MULTI_MATCH( channel_names=CHANNEL_SMARTENERGY_METERING, - models={"TS011F"}, stop_on_match_group=CHANNEL_SMARTENERGY_METERING, ) -class PolledSmartEnergyMetering(SmartEnergyMetering): - """Polled metering sensor.""" - - @property - def should_poll(self) -> bool: - """Poll the entity for current state.""" - return True - - async def async_update(self) -> None: - """Retrieve latest state.""" - if not self.available: - return - await self._channel.async_force_update() - - -@MULTI_MATCH(channel_names=CHANNEL_SMARTENERGY_METERING) class SmartEnergySummation(SmartEnergyMetering, id_suffix="summation_delivered"): """Smart Energy Metering summation sensor.""" @@ -523,6 +506,26 @@ class SmartEnergySummation(SmartEnergyMetering, id_suffix="summation_delivered") return round(cooked, 3) +@MULTI_MATCH( + channel_names=CHANNEL_SMARTENERGY_METERING, + models={"TS011F"}, + stop_on_match_group=CHANNEL_SMARTENERGY_METERING, +) +class PolledSmartEnergySummation(SmartEnergySummation): + """Polled Smart Energy Metering summation sensor.""" + + @property + def should_poll(self) -> bool: + """Poll the entity for current state.""" + return True + + async def async_update(self) -> None: + """Retrieve latest state.""" + if not self.available: + return + await self._channel.async_force_update() + + @MULTI_MATCH(channel_names=CHANNEL_PRESSURE) class Pressure(Sensor): """Pressure sensor.""" From 937d0d731d03348696046a9783524ad5959dcb31 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 7 Jul 2022 12:46:19 -0500 Subject: [PATCH 16/18] Fix exception in doorbird logbook during startup (#74649) * Fix exception in doorbird logbook during startup Fixes ``` 2022-07-07 16:50:33.203 ERROR (MainThread) [homeassistant.helpers.integration_platform] Error processing platform doorbird.logbook Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 51, in _async_process_single_integration_platform_component await integration_platform.process_platform(hass, component_name, platform) File "/usr/src/homeassistant/homeassistant/components/logbook/__init__.py", line 159, in _process_logbook_platform platform.async_describe_events(hass, _async_describe_event) File "/usr/src/homeassistant/homeassistant/components/doorbird/logbook.py", line 43, in async_describe_events door_station = data[DOOR_STATION] KeyError: door_station ``` * py39 --- homeassistant/components/doorbird/logbook.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/doorbird/logbook.py b/homeassistant/components/doorbird/logbook.py index 110d3f22fbf..3b1563c2880 100644 --- a/homeassistant/components/doorbird/logbook.py +++ b/homeassistant/components/doorbird/logbook.py @@ -1,4 +1,7 @@ """Describe logbook events.""" +from __future__ import annotations + +from typing import Any from homeassistant.components.logbook.const import ( LOGBOOK_ENTRY_ENTITY_ID, @@ -28,12 +31,13 @@ def async_describe_events(hass, async_describe_event): ].get(doorbird_event, event.data.get(ATTR_ENTITY_ID)), } - domain_data = hass.data[DOMAIN] + domain_data: dict[str, Any] = hass.data[DOMAIN] - for config_entry_id in domain_data: - door_station = domain_data[config_entry_id][DOOR_STATION] - - for event in door_station.doorstation_events: + for data in domain_data.values(): + if DOOR_STATION not in data: + # We need to skip door_station_event_entity_ids + continue + for event in data[DOOR_STATION].doorstation_events: async_describe_event( DOMAIN, f"{DOMAIN}_{event}", async_describe_logbook_event ) From b73cc32ffbf6f572947b4221a3b66773c3efe81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mrozek?= Date: Fri, 8 Jul 2022 00:46:23 +0200 Subject: [PATCH 17/18] Update kaiterra-async-client to 1.0.0 (#74677) --- homeassistant/components/kaiterra/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/kaiterra/manifest.json b/homeassistant/components/kaiterra/manifest.json index 9f2a4c0013f..94b861524eb 100644 --- a/homeassistant/components/kaiterra/manifest.json +++ b/homeassistant/components/kaiterra/manifest.json @@ -2,7 +2,7 @@ "domain": "kaiterra", "name": "Kaiterra", "documentation": "https://www.home-assistant.io/integrations/kaiterra", - "requirements": ["kaiterra-async-client==0.0.2"], + "requirements": ["kaiterra-async-client==1.0.0"], "codeowners": ["@Michsior14"], "iot_class": "cloud_polling", "loggers": ["kaiterra_async_client"] diff --git a/requirements_all.txt b/requirements_all.txt index 8578c571fbb..4a35ee93e08 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -912,7 +912,7 @@ jellyfin-apiclient-python==1.8.1 jsonpath==0.82 # homeassistant.components.kaiterra -kaiterra-async-client==0.0.2 +kaiterra-async-client==1.0.0 # homeassistant.components.keba keba-kecontact==1.1.0 From 5018b91f6ce09455f5fd0a071c6cf45ea4a1bf37 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 7 Jul 2022 21:59:59 -0700 Subject: [PATCH 18/18] Bumped version to 2022.7.1 --- 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 c2ee7de691f..6902a728ea7 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 = 7 -PATCH_VERSION: Final = "0" +PATCH_VERSION: Final = "1" __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 b4994d55edb..48e3ea452ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2022.7.0" +version = "2022.7.1" license = {text = "Apache-2.0"} description = "Open-source home automation platform running on Python 3." readme = "README.rst"