From 47a54115251e6db026a813612abc6481ab32b179 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 31 Jan 2022 15:58:52 -0800 Subject: [PATCH] Bump aiohue to 4.0.1 (#65340) --- homeassistant/components/hue/bridge.py | 7 ++++--- homeassistant/components/hue/manifest.json | 2 +- homeassistant/components/hue/migration.py | 3 +-- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/hue/bridge.py b/homeassistant/components/hue/bridge.py index 3a529c15cf39..346cc67d2351 100644 --- a/homeassistant/components/hue/bridge.py +++ b/homeassistant/components/hue/bridge.py @@ -49,11 +49,12 @@ class HueBridge: self.logger = logging.getLogger(__name__) # store actual api connection to bridge as api app_key: str = self.config_entry.data[CONF_API_KEY] - websession = aiohttp_client.async_get_clientsession(hass) if self.api_version == 1: - self.api = HueBridgeV1(self.host, app_key, websession) + self.api = HueBridgeV1( + self.host, app_key, aiohttp_client.async_get_clientsession(hass) + ) else: - self.api = HueBridgeV2(self.host, app_key, websession) + self.api = HueBridgeV2(self.host, app_key) # store (this) bridge object in hass data hass.data.setdefault(DOMAIN, {})[self.config_entry.entry_id] = self diff --git a/homeassistant/components/hue/manifest.json b/homeassistant/components/hue/manifest.json index b9ffea7d3dfc..231c00e3d24f 100644 --- a/homeassistant/components/hue/manifest.json +++ b/homeassistant/components/hue/manifest.json @@ -3,7 +3,7 @@ "name": "Philips Hue", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/hue", - "requirements": ["aiohue==3.0.11"], + "requirements": ["aiohue==4.0.1"], "ssdp": [ { "manufacturer": "Royal Philips Electronics", diff --git a/homeassistant/components/hue/migration.py b/homeassistant/components/hue/migration.py index 3dbfef42d164..f779fccdb3b6 100644 --- a/homeassistant/components/hue/migration.py +++ b/homeassistant/components/hue/migration.py @@ -76,7 +76,6 @@ async def handle_v2_migration(hass: core.HomeAssistant, entry: ConfigEntry) -> N """Perform migration of devices and entities to V2 Id's.""" host = entry.data[CONF_HOST] api_key = entry.data[CONF_API_KEY] - websession = aiohttp_client.async_get_clientsession(hass) dev_reg = async_get_device_registry(hass) ent_reg = async_get_entity_registry(hass) LOGGER.info("Start of migration of devices and entities to support API schema 2") @@ -93,7 +92,7 @@ async def handle_v2_migration(hass: core.HomeAssistant, entry: ConfigEntry) -> N dev_ids[normalized_mac] = hass_dev.id # initialize bridge connection just for the migration - async with HueBridgeV2(host, api_key, websession) as api: + async with HueBridgeV2(host, api_key) as api: sensor_class_mapping = { SensorDeviceClass.BATTERY.value: ResourceTypes.DEVICE_POWER, diff --git a/requirements_all.txt b/requirements_all.txt index f1b59e57f12f..46de83efe472 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -191,7 +191,7 @@ aiohomekit==0.7.0 aiohttp_cors==0.7.0 # homeassistant.components.hue -aiohue==3.0.11 +aiohue==4.0.1 # homeassistant.components.homewizard aiohwenergy==0.8.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 94566810bcca..e59308f3529f 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -141,7 +141,7 @@ aiohomekit==0.7.0 aiohttp_cors==0.7.0 # homeassistant.components.hue -aiohue==3.0.11 +aiohue==4.0.1 # homeassistant.components.homewizard aiohwenergy==0.8.0