From 85c6a24665d012020261d08bfafd2610daf98fda Mon Sep 17 00:00:00 2001 From: Guy Khmelnitsky <3136012+GuyKh@users.noreply.github.com> Date: Mon, 17 Jan 2022 10:32:54 +0200 Subject: [PATCH] Bump Glances to 0.3.4 to fix async_timeout passing loop (#62090) * Bump Glances to 0.3.2 to fix async_timeout passing loop * Update requirements_all.txt * Update requirements_test_all.txt * Update config_flow.py * Update __init__.py * Update __init__.py * Update strings.json * Update config_flow.py * Update config_flow.py * Update __init__.py * Update bg.json * Remove `verify_ssl` translation * Revert "Remove `verify_ssl` translation" This reverts commit 906f9a01eaf9e8d229b7d977392875c00420d253. * Revert "Update bg.json" This reverts commit 1d0e69351fac0b96a1aa5da3e3ecc2153863c25a. * Update __init__.py * Update __init__.py * Update test_config_flow.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update homeassistant/components/glances/__init__.py Co-authored-by: Martin Hjelmare * Update __init__.py * Update config_flow.py * Update strings.json * Update test_config_flow.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update to glances_api 0.3.4 - with httpx_client parameter Co-authored-by: Martin Hjelmare --- homeassistant/components/glances/__init__.py | 12 ++++++------ homeassistant/components/glances/config_flow.py | 2 +- homeassistant/components/glances/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/glances/__init__.py b/homeassistant/components/glances/__init__.py index 506c49967f6..22f6ef2ed1d 100644 --- a/homeassistant/components/glances/__init__.py +++ b/homeassistant/components/glances/__init__.py @@ -19,10 +19,10 @@ from homeassistant.const import ( ) from homeassistant.core import HomeAssistant 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 +from homeassistant.helpers.httpx_client import get_async_client from homeassistant.helpers.typing import ConfigType from .const import ( @@ -111,7 +111,7 @@ class GlancesData: async def async_update(self): """Get the latest data from the Glances REST API.""" try: - await self.api.get_data() + await self.api.get_data("all") self.available = True except exceptions.GlancesApiError: _LOGGER.error("Unable to fetch data from Glances") @@ -123,7 +123,7 @@ class GlancesData: """Set up the Glances client.""" try: self.api = get_api(self.hass, self.config_entry.data) - await self.api.get_data() + await self.api.get_data("all") self.available = True _LOGGER.debug("Successfully connected to Glances") @@ -174,6 +174,6 @@ def get_api(hass, entry): """Return the api from glances_api.""" params = entry.copy() params.pop(CONF_NAME) - verify_ssl = params.pop(CONF_VERIFY_SSL) - session = async_get_clientsession(hass, verify_ssl) - return Glances(hass.loop, session, **params) + verify_ssl = params.pop(CONF_VERIFY_SSL, True) + httpx_client = get_async_client(hass, verify_ssl=verify_ssl) + return Glances(httpx_client=httpx_client, **params) diff --git a/homeassistant/components/glances/config_flow.py b/homeassistant/components/glances/config_flow.py index f00f3ca42f8..1ee7c2fa476 100644 --- a/homeassistant/components/glances/config_flow.py +++ b/homeassistant/components/glances/config_flow.py @@ -47,7 +47,7 @@ async def validate_input(hass: core.HomeAssistant, data): raise WrongVersion try: api = get_api(hass, data) - await api.get_data() + await api.get_data("all") except glances_api.exceptions.GlancesApiConnectionError as err: raise CannotConnect from err diff --git a/homeassistant/components/glances/manifest.json b/homeassistant/components/glances/manifest.json index 71e861cc69e..2b0b0f1a4ee 100644 --- a/homeassistant/components/glances/manifest.json +++ b/homeassistant/components/glances/manifest.json @@ -3,7 +3,7 @@ "name": "Glances", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/glances", - "requirements": ["glances_api==0.2.0"], + "requirements": ["glances_api==0.3.4"], "codeowners": ["@fabaff", "@engrbm87"], "iot_class": "local_polling" } diff --git a/requirements_all.txt b/requirements_all.txt index 227b0b337e8..a5ffbaa760f 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -743,7 +743,7 @@ gios==2.1.0 gitterpy==0.1.7 # homeassistant.components.glances -glances_api==0.2.0 +glances_api==0.3.4 # homeassistant.components.gntp gntp==1.0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0b10f0536ad..fe90d56fdb9 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -474,7 +474,7 @@ getmac==0.8.2 gios==2.1.0 # homeassistant.components.glances -glances_api==0.2.0 +glances_api==0.3.4 # homeassistant.components.goalzero goalzero==0.2.1