Bump aiohue to 4.0.1 (#65340)

This commit is contained in:
Paulus Schoutsen 2022-01-31 15:58:52 -08:00 committed by GitHub
parent 31709b92ac
commit 47a5411525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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",

View File

@ -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,

View File

@ -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

View File

@ -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