diff --git a/homeassistant/components/luftdaten/__init__.py b/homeassistant/components/luftdaten/__init__.py index a87c67620cd..f8a67fff2f3 100644 --- a/homeassistant/components/luftdaten/__init__.py +++ b/homeassistant/components/luftdaten/__init__.py @@ -24,7 +24,6 @@ from homeassistant.const import ( ) from homeassistant.core import callback from homeassistant.exceptions import ConfigEntryNotReady -from homeassistant.helpers.aiohttp_client import async_get_clientsession import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.event import async_track_time_interval @@ -175,11 +174,9 @@ async def async_setup_entry(hass, config_entry): hass.async_create_task(hass.config_entries.async_remove(config_entry.entry_id)) return False - session = async_get_clientsession(hass) - try: luftdaten = LuftDatenData( - Luftdaten(config_entry.data[CONF_SENSOR_ID], hass.loop, session), + Luftdaten(config_entry.data[CONF_SENSOR_ID]), config_entry.data.get(CONF_SENSORS, {}).get( CONF_MONITORED_CONDITIONS, SENSOR_KEYS ), diff --git a/homeassistant/components/luftdaten/config_flow.py b/homeassistant/components/luftdaten/config_flow.py index f13fcc831dc..56dee86e9fb 100644 --- a/homeassistant/components/luftdaten/config_flow.py +++ b/homeassistant/components/luftdaten/config_flow.py @@ -13,7 +13,6 @@ from homeassistant.const import ( CONF_SHOW_ON_MAP, ) from homeassistant.core import callback -from homeassistant.helpers import aiohttp_client import homeassistant.helpers.config_validation as cv from .const import CONF_SENSOR_ID, DEFAULT_SCAN_INTERVAL, DOMAIN @@ -69,8 +68,7 @@ class LuftDatenFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): if sensor_id in configured_sensors(self.hass): return self._show_form({CONF_SENSOR_ID: "already_configured"}) - session = aiohttp_client.async_get_clientsession(self.hass) - luftdaten = Luftdaten(user_input[CONF_SENSOR_ID], self.hass.loop, session) + luftdaten = Luftdaten(user_input[CONF_SENSOR_ID]) try: await luftdaten.get_data() valid = await luftdaten.validate_sensor() diff --git a/homeassistant/components/luftdaten/manifest.json b/homeassistant/components/luftdaten/manifest.json index f296093b556..fd355bd8d3c 100644 --- a/homeassistant/components/luftdaten/manifest.json +++ b/homeassistant/components/luftdaten/manifest.json @@ -3,7 +3,7 @@ "name": "Luftdaten", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/luftdaten", - "requirements": ["luftdaten==0.6.5"], + "requirements": ["luftdaten==0.7.1"], "codeowners": ["@fabaff"], "quality_scale": "gold", "iot_class": "cloud_polling" diff --git a/requirements_all.txt b/requirements_all.txt index 974b5014205..18b61d884ae 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -966,7 +966,7 @@ logi_circle==0.2.2 london-tube-status==0.2 # homeassistant.components.luftdaten -luftdaten==0.6.5 +luftdaten==0.7.1 # homeassistant.components.lupusec lupupy==0.0.21 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 82d1aefb1bc..027cec2714a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -591,7 +591,7 @@ libsoundtouch==0.8 logi_circle==0.2.2 # homeassistant.components.luftdaten -luftdaten==0.6.5 +luftdaten==0.7.1 # homeassistant.components.nmap_tracker mac-vendor-lookup==0.1.11