From 5fc5b53c01574874b711e757c4512e73cba5b1bf Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 10 Aug 2021 20:28:01 -0500 Subject: [PATCH 01/20] Ensure HomeKit passes min/max mireds as ints - adapted from #54372 --- homeassistant/components/homekit/type_lights.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/homekit/type_lights.py b/homeassistant/components/homekit/type_lights.py index 88e21272a4f0cc..2a1256dfddb122 100644 --- a/homeassistant/components/homekit/type_lights.py +++ b/homeassistant/components/homekit/type_lights.py @@ -1,5 +1,6 @@ """Class to hold all light accessories.""" import logging +import math from pyhap.const import CATEGORY_LIGHTBULB @@ -115,8 +116,8 @@ def __init__(self, *args): ) if self.is_color_temp_supported: - min_mireds = attributes.get(ATTR_MIN_MIREDS, 153) - max_mireds = attributes.get(ATTR_MAX_MIREDS, 500) + min_mireds = math.floor(attributes.get(ATTR_MIN_MIREDS, 153)) + max_mireds = math.ceil(attributes.get(ATTR_MAX_MIREDS, 500)) serv_light = serv_light_secondary or serv_light_primary self.char_color_temperature = serv_light.configure_char( CHAR_COLOR_TEMPERATURE, From 7d67caba44ed0f472fa36d7793385d2724eb7748 Mon Sep 17 00:00:00 2001 From: Phil Cole Date: Wed, 11 Aug 2021 15:34:36 +0100 Subject: [PATCH 02/20] Use pycarwings2 2.11 (#54424) --- homeassistant/components/nissan_leaf/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/nissan_leaf/manifest.json b/homeassistant/components/nissan_leaf/manifest.json index 298343d2d8d25f..55cd28d59fa213 100644 --- a/homeassistant/components/nissan_leaf/manifest.json +++ b/homeassistant/components/nissan_leaf/manifest.json @@ -2,7 +2,7 @@ "domain": "nissan_leaf", "name": "Nissan Leaf", "documentation": "https://www.home-assistant.io/integrations/nissan_leaf", - "requirements": ["pycarwings2==2.10"], + "requirements": ["pycarwings2==2.11"], "codeowners": ["@filcole"], "iot_class": "cloud_polling" } diff --git a/requirements_all.txt b/requirements_all.txt index 82edfd81d57b3c..8d3537194e1653 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1342,7 +1342,7 @@ pyblackbird==0.5 pybotvac==0.0.21 # homeassistant.components.nissan_leaf -pycarwings2==2.10 +pycarwings2==2.11 # homeassistant.components.cloudflare pycfdns==1.2.1 From 72e548de5f140de595157f679878b502bfbba699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 11 Aug 2021 12:50:17 +0300 Subject: [PATCH 03/20] Fix Huawei LTE entity state updating (#54447) Since 91a2b96, we no longer key this by the router URL, but the relevant config entry unique id. Closes https://github.com/home-assistant/core/issues/54243 --- homeassistant/components/huawei_lte/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index 81b715b71fef05..0c545486c82956 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -665,9 +665,9 @@ async def async_added_to_hass(self) -> None: async_dispatcher_connect(self.hass, UPDATE_SIGNAL, self._async_maybe_update) ) - async def _async_maybe_update(self, url: str) -> None: + async def _async_maybe_update(self, config_entry_unique_id: str) -> None: """Update state if the update signal comes from our router.""" - if url == self.router.url: + if config_entry_unique_id == self.router.config_entry.unique_id: self.async_schedule_update_ha_state(True) async def async_will_remove_from_hass(self) -> None: From 4d01dd3c0cf5c880f6968e9dbea214df9e18335f Mon Sep 17 00:00:00 2001 From: Felix <0xFelix@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:17:12 +0200 Subject: [PATCH 04/20] Strip attributes whitespace in universal media_player (#54451) When using whitespace in attributes the lookup of the state attribute fails because an entity with whitespace in its name cannot be found. Works: entity_id|state_attribute Does not work: entity_id | state_attribute Fixes #53804 --- homeassistant/components/universal/media_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/universal/media_player.py b/homeassistant/components/universal/media_player.py index a2981852dc173b..f3d4a6f1355a4a 100644 --- a/homeassistant/components/universal/media_player.py +++ b/homeassistant/components/universal/media_player.py @@ -158,7 +158,7 @@ def __init__( self._cmds = commands self._attrs = {} for key, val in attributes.items(): - attr = val.split("|", 1) + attr = list(map(str.strip, val.split("|", 1))) if len(attr) == 1: attr.append(None) self._attrs[key] = attr From 1d45a80a92b9b982693b8793594fc3a2f7267869 Mon Sep 17 00:00:00 2001 From: Robert Hillis Date: Wed, 11 Aug 2021 10:13:38 -0400 Subject: [PATCH 05/20] Bump notifications-android-tv to 0.1.3 (#54462) Co-authored-by: Martin Hjelmare --- homeassistant/components/nfandroidtv/__init__.py | 7 +------ homeassistant/components/nfandroidtv/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/nfandroidtv/__init__.py b/homeassistant/components/nfandroidtv/__init__.py index 90a76c1c7477a0..35aecdb6916e39 100644 --- a/homeassistant/components/nfandroidtv/__init__.py +++ b/homeassistant/components/nfandroidtv/__init__.py @@ -1,6 +1,4 @@ """The NFAndroidTV integration.""" -import logging - from notifications_android_tv.notifications import ConnectError, Notifications from homeassistant.components.notify import DOMAIN as NOTIFY @@ -12,8 +10,6 @@ from .const import DOMAIN -_LOGGER = logging.getLogger(__name__) - PLATFORMS = [NOTIFY] @@ -41,8 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: try: await hass.async_add_executor_job(Notifications, host) except ConnectError as ex: - _LOGGER.warning("Failed to connect: %s", ex) - raise ConfigEntryNotReady from ex + raise ConfigEntryNotReady("Failed to connect") from ex hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN][entry.entry_id] = { diff --git a/homeassistant/components/nfandroidtv/manifest.json b/homeassistant/components/nfandroidtv/manifest.json index 5516f144fd40f3..c1dea03aa09904 100644 --- a/homeassistant/components/nfandroidtv/manifest.json +++ b/homeassistant/components/nfandroidtv/manifest.json @@ -2,7 +2,7 @@ "domain": "nfandroidtv", "name": "Notifications for Android TV / Fire TV", "documentation": "https://www.home-assistant.io/integrations/nfandroidtv", - "requirements": ["notifications-android-tv==0.1.2"], + "requirements": ["notifications-android-tv==0.1.3"], "codeowners": ["@tkdrob"], "config_flow": true, "iot_class": "local_push" diff --git a/requirements_all.txt b/requirements_all.txt index 8d3537194e1653..2c79bc76a69fbf 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1038,7 +1038,7 @@ niluclient==0.1.2 noaa-coops==0.1.8 # homeassistant.components.nfandroidtv -notifications-android-tv==0.1.2 +notifications-android-tv==0.1.3 # homeassistant.components.notify_events notify-events==1.0.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 8245b165cff471..b8f2683ee3a11b 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -579,7 +579,7 @@ nettigo-air-monitor==1.0.0 nexia==0.9.11 # homeassistant.components.nfandroidtv -notifications-android-tv==0.1.2 +notifications-android-tv==0.1.3 # homeassistant.components.notify_events notify-events==1.0.4 From 6382061b5791e7a148d4cf84a4085d43a91f1d96 Mon Sep 17 00:00:00 2001 From: ehendrix23 Date: Wed, 11 Aug 2021 21:17:25 -0600 Subject: [PATCH 06/20] Updates to bump MyQ to 3.1.2 (#54488) --- .coveragerc | 1 + homeassistant/components/myq/config_flow.py | 2 +- homeassistant/components/myq/cover.py | 8 ++++++-- homeassistant/components/myq/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index 1f28a9a2aeeb1d..6ad8658c702fd2 100644 --- a/.coveragerc +++ b/.coveragerc @@ -672,6 +672,7 @@ omit = homeassistant/components/mystrom/light.py homeassistant/components/mystrom/switch.py homeassistant/components/myq/__init__.py + homeassistant/components/myq/cover.py homeassistant/components/nad/media_player.py homeassistant/components/nanoleaf/light.py homeassistant/components/neato/__init__.py diff --git a/homeassistant/components/myq/config_flow.py b/homeassistant/components/myq/config_flow.py index 78a751a18b1e95..8c088de6715229 100644 --- a/homeassistant/components/myq/config_flow.py +++ b/homeassistant/components/myq/config_flow.py @@ -31,7 +31,7 @@ async def _async_validate_input(self, username, password): """Validate the user input allows us to connect.""" websession = aiohttp_client.async_get_clientsession(self.hass) try: - await pymyq.login(username, password, websession) + await pymyq.login(username, password, websession, True) except InvalidCredentialsError: return {CONF_PASSWORD: "invalid_auth"} except MyQError: diff --git a/homeassistant/components/myq/cover.py b/homeassistant/components/myq/cover.py index 3d587635f2d41e..8d36db8e0ab808 100644 --- a/homeassistant/components/myq/cover.py +++ b/homeassistant/components/myq/cover.py @@ -115,7 +115,9 @@ async def async_close_cover(self, **kwargs): # Write closing state to HASS self.async_write_ha_state() - if not await wait_task: + result = wait_task if isinstance(wait_task, bool) else await wait_task + + if not result: _LOGGER.error("Closing of cover %s failed", self._device.name) # Write final state to HASS @@ -137,7 +139,9 @@ async def async_open_cover(self, **kwargs): # Write opening state to HASS self.async_write_ha_state() - if not await wait_task: + result = wait_task if isinstance(wait_task, bool) else await wait_task + + if not result: _LOGGER.error("Opening of cover %s failed", self._device.name) # Write final state to HASS diff --git a/homeassistant/components/myq/manifest.json b/homeassistant/components/myq/manifest.json index a93501c941f381..a4de12290f16f0 100644 --- a/homeassistant/components/myq/manifest.json +++ b/homeassistant/components/myq/manifest.json @@ -2,7 +2,7 @@ "domain": "myq", "name": "MyQ", "documentation": "https://www.home-assistant.io/integrations/myq", - "requirements": ["pymyq==3.0.4"], + "requirements": ["pymyq==3.1.2"], "codeowners": ["@bdraco"], "config_flow": true, "homekit": { diff --git a/requirements_all.txt b/requirements_all.txt index 2c79bc76a69fbf..925fcd9975b91e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1610,7 +1610,7 @@ pymonoprice==0.3 pymsteams==0.1.12 # homeassistant.components.myq -pymyq==3.0.4 +pymyq==3.1.2 # homeassistant.components.mysensors pymysensors==0.21.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b8f2683ee3a11b..1b9a882f8f32f6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -917,7 +917,7 @@ pymodbus==2.5.2 pymonoprice==0.3 # homeassistant.components.myq -pymyq==3.0.4 +pymyq==3.1.2 # homeassistant.components.mysensors pymysensors==0.21.0 From 6f3879fc92ac17efa845c99d3ba88654157d288b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Thu, 12 Aug 2021 07:30:35 +0200 Subject: [PATCH 07/20] Add missing PRESSURE_BAR conversion (#54497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add missing PRESSURE_BAR * style Signed-off-by: Daniel Hjelseth Høyer * valid units Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/util/pressure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/util/pressure.py b/homeassistant/util/pressure.py index 188cf66491e421..95b32a696434e8 100644 --- a/homeassistant/util/pressure.py +++ b/homeassistant/util/pressure.py @@ -5,6 +5,7 @@ from homeassistant.const import ( PRESSURE, + PRESSURE_BAR, PRESSURE_HPA, PRESSURE_INHG, PRESSURE_MBAR, @@ -16,6 +17,7 @@ VALID_UNITS: tuple[str, ...] = ( PRESSURE_PA, PRESSURE_HPA, + PRESSURE_BAR, PRESSURE_MBAR, PRESSURE_INHG, PRESSURE_PSI, @@ -24,6 +26,7 @@ UNIT_CONVERSION: dict[str, float] = { PRESSURE_PA: 1, PRESSURE_HPA: 1 / 100, + PRESSURE_BAR: 1 / 100000, PRESSURE_MBAR: 1 / 100, PRESSURE_INHG: 1 / 3386.389, PRESSURE_PSI: 1 / 6894.757, From 482e00a07145a7cbb1409830c96bcbdcda7ae4bc Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Sun, 15 Aug 2021 06:09:06 -0700 Subject: [PATCH 08/20] Treat temporary errors as warnings for Tesla (#54515) * Treat temporary errors as warnings for Tesla closes #53391 * Apply suggestions from code review Co-authored-by: J. Nick Koston * Black Co-authored-by: J. Nick Koston --- homeassistant/components/tesla/__init__.py | 9 +++++++++ homeassistant/components/tesla/config_flow.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tesla/__init__.py b/homeassistant/components/tesla/__init__.py index d945d87243ec62..798e769dc47591 100644 --- a/homeassistant/components/tesla/__init__.py +++ b/homeassistant/components/tesla/__init__.py @@ -177,6 +177,15 @@ async def async_setup_entry(hass, config_entry): await async_client.aclose() if ex.code == HTTP_UNAUTHORIZED: raise ConfigEntryAuthFailed from ex + if ex.message in [ + "VEHICLE_UNAVAILABLE", + "TOO_MANY_REQUESTS", + "SERVICE_MAINTENANCE", + "UPSTREAM_TIMEOUT", + ]: + raise ConfigEntryNotReady( + f"Temporarily unable to communicate with Tesla API: {ex.message}" + ) from ex _LOGGER.error("Unable to communicate with Tesla API: %s", ex.message) return False diff --git a/homeassistant/components/tesla/config_flow.py b/homeassistant/components/tesla/config_flow.py index 46bc49b126b8e1..5a88999a7e36f8 100644 --- a/homeassistant/components/tesla/config_flow.py +++ b/homeassistant/components/tesla/config_flow.py @@ -175,7 +175,7 @@ async def validate_input(hass: core.HomeAssistant, data): if ex.code == HTTP_UNAUTHORIZED: _LOGGER.error("Invalid credentials: %s", ex) raise InvalidAuth() from ex - _LOGGER.error("Unable to communicate with Tesla API: %s", ex) + _LOGGER.error("Unable to communicate with Tesla API: %s", ex.message) raise CannotConnect() from ex finally: await async_client.aclose() From 1c503244c6f8fbabc98d0d36b5720e6414292fcf Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 12 Aug 2021 23:33:02 +0200 Subject: [PATCH 09/20] Fix attributes not showing after using entity class attributes (#54558) --- .../bmw_connected_drive/__init__.py | 5 -- .../bmw_connected_drive/binary_sensor.py | 51 ++++++++----------- .../bmw_connected_drive/device_tracker.py | 1 + 3 files changed, 21 insertions(+), 36 deletions(-) diff --git a/homeassistant/components/bmw_connected_drive/__init__.py b/homeassistant/components/bmw_connected_drive/__init__.py index 3bd2365f88e4c1..17e57b5d09c497 100644 --- a/homeassistant/components/bmw_connected_drive/__init__.py +++ b/homeassistant/components/bmw_connected_drive/__init__.py @@ -335,11 +335,6 @@ def __init__(self, account, vehicle): "manufacturer": vehicle.attributes.get("brand"), } - @property - def extra_state_attributes(self): - """Return the state attributes of the sensor.""" - return self._attrs - def update_callback(self): """Schedule a state update.""" self.schedule_update_ha_state(True) diff --git a/homeassistant/components/bmw_connected_drive/binary_sensor.py b/homeassistant/components/bmw_connected_drive/binary_sensor.py index d7f0d1501931ca..a7fd72fc1a7e3b 100644 --- a/homeassistant/components/bmw_connected_drive/binary_sensor.py +++ b/homeassistant/components/bmw_connected_drive/binary_sensor.py @@ -85,54 +85,38 @@ def __init__( def update(self): """Read new state data from the library.""" vehicle_state = self._vehicle.state + result = self._attrs.copy() # device class opening: On means open, Off means closed if self._attribute == "lids": _LOGGER.debug("Status of lid: %s", vehicle_state.all_lids_closed) - self._attr_state = not vehicle_state.all_lids_closed - if self._attribute == "windows": - self._attr_state = not vehicle_state.all_windows_closed - # device class lock: On means unlocked, Off means locked - if self._attribute == "door_lock_state": - # Possible values: LOCKED, SECURED, SELECTIVE_LOCKED, UNLOCKED - self._attr_state = vehicle_state.door_lock_state not in [ - LockState.LOCKED, - LockState.SECURED, - ] - # device class light: On means light detected, Off means no light - if self._attribute == "lights_parking": - self._attr_state = vehicle_state.are_parking_lights_on - # device class problem: On means problem detected, Off means no problem - if self._attribute == "condition_based_services": - self._attr_state = not vehicle_state.are_all_cbs_ok - if self._attribute == "check_control_messages": - self._attr_state = vehicle_state.has_check_control_messages - # device class power: On means power detected, Off means no power - if self._attribute == "charging_status": - self._attr_state = vehicle_state.charging_status in [ChargingState.CHARGING] - # device class plug: On means device is plugged in, - # Off means device is unplugged - if self._attribute == "connection_status": - self._attr_state = vehicle_state.connection_status == "CONNECTED" - - vehicle_state = self._vehicle.state - result = self._attrs.copy() - - if self._attribute == "lids": + self._attr_is_on = not vehicle_state.all_lids_closed for lid in vehicle_state.lids: result[lid.name] = lid.state.value elif self._attribute == "windows": + self._attr_is_on = not vehicle_state.all_windows_closed for window in vehicle_state.windows: result[window.name] = window.state.value + # device class lock: On means unlocked, Off means locked elif self._attribute == "door_lock_state": + # Possible values: LOCKED, SECURED, SELECTIVE_LOCKED, UNLOCKED + self._attr_is_on = vehicle_state.door_lock_state not in [ + LockState.LOCKED, + LockState.SECURED, + ] result["door_lock_state"] = vehicle_state.door_lock_state.value result["last_update_reason"] = vehicle_state.last_update_reason + # device class light: On means light detected, Off means no light elif self._attribute == "lights_parking": + self._attr_is_on = vehicle_state.are_parking_lights_on result["lights_parking"] = vehicle_state.parking_lights.value + # device class problem: On means problem detected, Off means no problem elif self._attribute == "condition_based_services": + self._attr_is_on = not vehicle_state.are_all_cbs_ok for report in vehicle_state.condition_based_services: result.update(self._format_cbs_report(report)) elif self._attribute == "check_control_messages": + self._attr_is_on = vehicle_state.has_check_control_messages check_control_messages = vehicle_state.check_control_messages has_check_control_messages = vehicle_state.has_check_control_messages if has_check_control_messages: @@ -142,13 +126,18 @@ def update(self): result["check_control_messages"] = cbs_list else: result["check_control_messages"] = "OK" + # device class power: On means power detected, Off means no power elif self._attribute == "charging_status": + self._attr_is_on = vehicle_state.charging_status in [ChargingState.CHARGING] result["charging_status"] = vehicle_state.charging_status.value result["last_charging_end_result"] = vehicle_state.last_charging_end_result + # device class plug: On means device is plugged in, + # Off means device is unplugged elif self._attribute == "connection_status": + self._attr_is_on = vehicle_state.connection_status == "CONNECTED" result["connection_status"] = vehicle_state.connection_status - self._attr_extra_state_attributes = sorted(result.items()) + self._attr_extra_state_attributes = result def _format_cbs_report(self, report): result = {} diff --git a/homeassistant/components/bmw_connected_drive/device_tracker.py b/homeassistant/components/bmw_connected_drive/device_tracker.py index 62b2ed9b9d9fe5..c788051dc9aaac 100644 --- a/homeassistant/components/bmw_connected_drive/device_tracker.py +++ b/homeassistant/components/bmw_connected_drive/device_tracker.py @@ -59,6 +59,7 @@ def source_type(self): def update(self): """Update state of the decvice tracker.""" + self._attr_extra_state_attributes = self._attrs self._location = ( self._vehicle.state.gps_position if self._vehicle.state.is_vehicle_tracking_enabled From ab823693209614503e577e20d44b93ada98c1c63 Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Sat, 14 Aug 2021 02:44:52 -0400 Subject: [PATCH 10/20] Upgrade qnapstats library to 0.4.0 (#54571) --- homeassistant/components/qnap/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/qnap/manifest.json b/homeassistant/components/qnap/manifest.json index abd5d6f5a4a6dd..217d14a6adf3d6 100644 --- a/homeassistant/components/qnap/manifest.json +++ b/homeassistant/components/qnap/manifest.json @@ -2,7 +2,7 @@ "domain": "qnap", "name": "QNAP", "documentation": "https://www.home-assistant.io/integrations/qnap", - "requirements": ["qnapstats==0.3.1"], + "requirements": ["qnapstats==0.4.0"], "codeowners": ["@colinodell"], "iot_class": "local_polling" } diff --git a/requirements_all.txt b/requirements_all.txt index 925fcd9975b91e..3906e42902e4d6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1990,7 +1990,7 @@ pyzbar==0.1.7 pyzerproc==0.4.8 # homeassistant.components.qnap -qnapstats==0.3.1 +qnapstats==0.4.0 # homeassistant.components.quantum_gateway quantum-gateway==0.0.5 From f43151081bbc6e053063788747956e86ead74ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Fri, 13 Aug 2021 11:38:14 +0200 Subject: [PATCH 11/20] Fix bug in ambiclimate (#54579) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix ambiclimate Signed-off-by: Daniel Hjelseth Høyer * Fix ambiclimate Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/components/ambiclimate/climate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/ambiclimate/climate.py b/homeassistant/components/ambiclimate/climate.py index 8cfebb1bf698d5..aa4be202865ed0 100644 --- a/homeassistant/components/ambiclimate/climate.py +++ b/homeassistant/components/ambiclimate/climate.py @@ -154,8 +154,6 @@ def __init__(self, heater, store): "name": self.name, "manufacturer": "Ambiclimate", } - self._attr_min_temp = heater.get_min_temp() - self._attr_max_temp = heater.get_max_temp() async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" @@ -184,6 +182,8 @@ async def async_update(self) -> None: await self._store.async_save(token_info) data = await self._heater.update_device() + self._attr_min_temp = self._heater.get_min_temp() + self._attr_max_temp = self._heater.get_max_temp() self._attr_target_temperature = data.get("target_temperature") self._attr_current_temperature = data.get("temperature") self._attr_current_humidity = data.get("humidity") From 0f60a5a8c0b430d189c0db53e4a53c9b198e037e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Mon, 16 Aug 2021 04:57:18 +0200 Subject: [PATCH 12/20] Fix Tibber last reset (#54582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/components/tibber/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index b5012cdc41d239..f092e1d8f55233 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -137,6 +137,7 @@ class TibberSensorEntityDescription(SensorEntityDescription): device_class=DEVICE_CLASS_ENERGY, unit_of_measurement=ENERGY_KILO_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, + reset_type=ResetType.NEVER, ), "lastMeterProduction": TibberSensorEntityDescription( key="lastMeterProduction", @@ -144,6 +145,7 @@ class TibberSensorEntityDescription(SensorEntityDescription): device_class=DEVICE_CLASS_ENERGY, unit_of_measurement=ENERGY_KILO_WATT_HOUR, state_class=STATE_CLASS_MEASUREMENT, + reset_type=ResetType.NEVER, ), "voltagePhase1": TibberSensorEntityDescription( key="voltagePhase1", From 5a5bbef1b8b3ccf4f10f1903d1243bb1cc4b7b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Sun, 15 Aug 2021 13:16:10 +0200 Subject: [PATCH 13/20] Adax, update requirements (#54587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/components/adax/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/adax/manifest.json b/homeassistant/components/adax/manifest.json index 36106290ed6c20..3d2c9273d05972 100644 --- a/homeassistant/components/adax/manifest.json +++ b/homeassistant/components/adax/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/adax", "requirements": [ - "adax==0.0.1" + "adax==0.1.1" ], "codeowners": [ "@danielhiversen" diff --git a/requirements_all.txt b/requirements_all.txt index 3906e42902e4d6..3bb90bec9cf780 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -106,7 +106,7 @@ adafruit-circuitpython-dht==3.6.0 adafruit-circuitpython-mcp230xx==2.2.2 # homeassistant.components.adax -adax==0.0.1 +adax==0.1.1 # homeassistant.components.androidtv adb-shell[async]==0.3.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1b9a882f8f32f6..ff4b2e61468d37 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -48,7 +48,7 @@ abodepy==1.2.0 accuweather==0.2.0 # homeassistant.components.adax -adax==0.0.1 +adax==0.1.1 # homeassistant.components.androidtv adb-shell[async]==0.3.4 From 2f2038c14723f28b55c6b9eec1a63bbd4f605d78 Mon Sep 17 00:00:00 2001 From: Oxan van Leeuwen Date: Sat, 14 Aug 2021 08:27:47 +0200 Subject: [PATCH 14/20] Clamp color temperature to supported range in ESPHome light (#54595) ESPHome devices initially report a color temperature of 0 or 1 until it has been changed by the user. This broke the conversion from RGBWW to an RGB color. Fixes #54293. --- homeassistant/components/esphome/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/esphome/light.py b/homeassistant/components/esphome/light.py index b89a75ab76a0c4..aeecc22d9f1702 100644 --- a/homeassistant/components/esphome/light.py +++ b/homeassistant/components/esphome/light.py @@ -230,7 +230,7 @@ def rgbww_color(self) -> tuple[int, int, int, int, int] | None: # Try to reverse white + color temp to cwww min_ct = self._static_info.min_mireds max_ct = self._static_info.max_mireds - color_temp = self._state.color_temperature + color_temp = min(max(self._state.color_temperature, min_ct), max_ct) white = self._state.white ww_frac = (color_temp - min_ct) / (max_ct - min_ct) From 3c3a6e6cb4959e34bf012aaef6f02ba726d52c40 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 14 Aug 2021 01:26:57 -0500 Subject: [PATCH 15/20] Bump zeroconf to 0.35.0 (#54604) Fixes https://github.com/home-assistant/core/issues/54531 Fixes https://github.com/home-assistant/core/issues/54434 Fixes https://github.com/home-assistant/core/issues/54487 --- homeassistant/components/zeroconf/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/zeroconf/manifest.json b/homeassistant/components/zeroconf/manifest.json index 83db312601c51f..b971ec0617976b 100644 --- a/homeassistant/components/zeroconf/manifest.json +++ b/homeassistant/components/zeroconf/manifest.json @@ -2,7 +2,7 @@ "domain": "zeroconf", "name": "Zero-configuration networking (zeroconf)", "documentation": "https://www.home-assistant.io/integrations/zeroconf", - "requirements": ["zeroconf==0.34.3"], + "requirements": ["zeroconf==0.35.0"], "dependencies": ["network", "api"], "codeowners": ["@bdraco"], "quality_scale": "internal", diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 323b1c8603409c..1b0d7a3e12df82 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -33,7 +33,7 @@ sqlalchemy==1.4.17 voluptuous-serialize==2.4.0 voluptuous==0.12.1 yarl==1.6.3 -zeroconf==0.34.3 +zeroconf==0.35.0 pycryptodome>=3.6.6 diff --git a/requirements_all.txt b/requirements_all.txt index 3bb90bec9cf780..54c982abf07bbe 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2439,7 +2439,7 @@ zeep[async]==4.0.0 zengge==0.2 # homeassistant.components.zeroconf -zeroconf==0.34.3 +zeroconf==0.35.0 # homeassistant.components.zha zha-quirks==0.0.59 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ff4b2e61468d37..b3a53cf71028c5 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1341,7 +1341,7 @@ youless-api==0.10 zeep[async]==4.0.0 # homeassistant.components.zeroconf -zeroconf==0.34.3 +zeroconf==0.35.0 # homeassistant.components.zha zha-quirks==0.0.59 From 8d1bd55b68d80216e534b8480e801bf7a3ef8a67 Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Sun, 15 Aug 2021 21:33:48 +0200 Subject: [PATCH 16/20] Bump py-synologydsm-api to 1.0.4 (#54610) --- homeassistant/components/synology_dsm/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/synology_dsm/manifest.json b/homeassistant/components/synology_dsm/manifest.json index 04d7f43bb75251..8d8d30c2cf889e 100644 --- a/homeassistant/components/synology_dsm/manifest.json +++ b/homeassistant/components/synology_dsm/manifest.json @@ -2,7 +2,7 @@ "domain": "synology_dsm", "name": "Synology DSM", "documentation": "https://www.home-assistant.io/integrations/synology_dsm", - "requirements": ["py-synologydsm-api==1.0.3"], + "requirements": ["py-synologydsm-api==1.0.4"], "codeowners": ["@hacf-fr", "@Quentame", "@mib1185"], "config_flow": true, "ssdp": [ diff --git a/requirements_all.txt b/requirements_all.txt index 54c982abf07bbe..2d026810c3f440 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1254,7 +1254,7 @@ py-nightscout==1.2.2 py-schluter==0.1.7 # homeassistant.components.synology_dsm -py-synologydsm-api==1.0.3 +py-synologydsm-api==1.0.4 # homeassistant.components.zabbix py-zabbix==1.1.7 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b3a53cf71028c5..f1619c2319c1b2 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -702,7 +702,7 @@ py-melissa-climate==2.1.4 py-nightscout==1.2.2 # homeassistant.components.synology_dsm -py-synologydsm-api==1.0.3 +py-synologydsm-api==1.0.4 # homeassistant.components.seventeentrack py17track==3.2.1 From dd1ef7fa5553f0a5633d24fdd33236bd23168af0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 15 Aug 2021 19:56:56 -0700 Subject: [PATCH 17/20] Guard partial upgrade (#54617) --- homeassistant/components/http/forwarded.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/http/forwarded.py b/homeassistant/components/http/forwarded.py index 9a76866ba21f54..6dd2d9adb8a4cb 100644 --- a/homeassistant/components/http/forwarded.py +++ b/homeassistant/components/http/forwarded.py @@ -65,6 +65,11 @@ def async_setup_forwarded( try: from hass_nabucasa import remote # pylint: disable=import-outside-toplevel + + # venv users might have already loaded it before it got upgraded so guard for this + # This can only happen when people upgrade from before 2021.8.5. + if not hasattr(remote, "is_cloud_request"): + remote = None except ImportError: remote = None From 5af94c42dbfe4822b16fc86fd4f03d0261163a98 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 16 Aug 2021 04:57:37 +0200 Subject: [PATCH 18/20] Solve switch/verify register type convert problem in modbus (#54645) --- homeassistant/components/modbus/base_platform.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/modbus/base_platform.py b/homeassistant/components/modbus/base_platform.py index 5b3cdfb48eec24..288cfc7022aace 100644 --- a/homeassistant/components/modbus/base_platform.py +++ b/homeassistant/components/modbus/base_platform.py @@ -189,9 +189,9 @@ def __init__(self, hub: ModbusHub, config: dict) -> None: self._verify_address = config[CONF_VERIFY].get( CONF_ADDRESS, config[CONF_ADDRESS] ) - self._verify_type = config[CONF_VERIFY].get( - CONF_INPUT_TYPE, convert[config[CONF_WRITE_TYPE]][0] - ) + self._verify_type = convert[ + config[CONF_VERIFY].get(CONF_INPUT_TYPE, config[CONF_WRITE_TYPE]) + ][0] self._state_on = config[CONF_VERIFY].get(CONF_STATE_ON, self.command_on) self._state_off = config[CONF_VERIFY].get(CONF_STATE_OFF, self._command_off) else: From 848885c658800905950c3b7c86cae089e5b0f494 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Mon, 16 Aug 2021 14:56:21 +1200 Subject: [PATCH 19/20] Send color_brightness to ESPHome devices on 1.20 (pre-color_mode) (#54670) --- homeassistant/components/esphome/light.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/esphome/light.py b/homeassistant/components/esphome/light.py index aeecc22d9f1702..c6cf97420820d2 100644 --- a/homeassistant/components/esphome/light.py +++ b/homeassistant/components/esphome/light.py @@ -105,8 +105,8 @@ async def async_turn_on(self, **kwargs: Any) -> None: color_bri = max(rgb) # normalize rgb data["rgb"] = tuple(x / (color_bri or 1) for x in rgb) + data["color_brightness"] = color_bri if self._supports_color_mode: - data["color_brightness"] = color_bri data["color_mode"] = LightColorMode.RGB if (rgbw_ha := kwargs.get(ATTR_RGBW_COLOR)) is not None: @@ -116,8 +116,8 @@ async def async_turn_on(self, **kwargs: Any) -> None: # normalize rgb data["rgb"] = tuple(x / (color_bri or 1) for x in rgb) data["white"] = w + data["color_brightness"] = color_bri if self._supports_color_mode: - data["color_brightness"] = color_bri data["color_mode"] = LightColorMode.RGB_WHITE if (rgbww_ha := kwargs.get(ATTR_RGBWW_COLOR)) is not None: @@ -144,8 +144,8 @@ async def async_turn_on(self, **kwargs: Any) -> None: data["color_temperature"] = min_ct + ct_ratio * (max_ct - min_ct) target_mode = LightColorMode.RGB_COLOR_TEMPERATURE + data["color_brightness"] = color_bri if self._supports_color_mode: - data["color_brightness"] = color_bri data["color_mode"] = target_mode if (flash := kwargs.get(ATTR_FLASH)) is not None: From 700f149ef86f1054522706b3899a760490abc5a4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 15 Aug 2021 20:06:46 -0700 Subject: [PATCH 20/20] Bumped version to 2021.8.7 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 8765dcbc94b315..c96f621ade2c80 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -5,7 +5,7 @@ MAJOR_VERSION: Final = 2021 MINOR_VERSION: Final = 8 -PATCH_VERSION: Final = "6" +PATCH_VERSION: Final = "7" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 8, 0)