diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index f87502c..174501d 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -1,4 +1,4 @@ pip==24.2 -pre-commit==3.8.0 +pre-commit==4.0.1 black==24.10.0 -flake8==7.1.1 +flake8==7.1.1 \ No newline at end of file diff --git a/custom_components/myenergi/__init__.py b/custom_components/myenergi/__init__.py index c9b515d..ca7a6e9 100644 --- a/custom_components/myenergi/__init__.py +++ b/custom_components/myenergi/__init__.py @@ -15,6 +15,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from homeassistant.helpers.update_coordinator import UpdateFailed +from homeassistant.helpers.httpx_client import get_async_client from pymyenergi.client import MyenergiClient from pymyenergi.connection import Connection @@ -48,8 +49,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): app_email = entry.data.get(CONF_APP_EMAIL) app_password = entry.data.get(CONF_APP_PASSWORD) + async_client = get_async_client(hass) + conn = await hass.async_add_executor_job( - Connection, username, password, app_password, app_email + Connection, username, password, app_password, app_email, 20, async_client ) if app_email and app_password: await conn.discoverLocations() @@ -107,6 +110,7 @@ async def _async_update_data(self): await self.client.refresh() await self.client.refresh_history(utc_today, 24, "hour") except Exception as exception: + _LOGGER.debug(exception) raise UpdateFailed() from exception diff --git a/custom_components/myenergi/const.py b/custom_components/myenergi/const.py index 435a6c0..2c94fae 100644 --- a/custom_components/myenergi/const.py +++ b/custom_components/myenergi/const.py @@ -4,7 +4,7 @@ NAME = "myenergi" DOMAIN = "myenergi" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.0.28" +VERSION = "0.0.29" ATTRIBUTION = "Data provided by myenergi" ISSUE_URL = "https://github.com/CJNE/ha-myenergi/issues" diff --git a/custom_components/myenergi/manifest.json b/custom_components/myenergi/manifest.json index 1cd9314..4be3f61 100644 --- a/custom_components/myenergi/manifest.json +++ b/custom_components/myenergi/manifest.json @@ -7,6 +7,6 @@ "documentation": "https://github.com/cjne/ha-myenergi", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/cjne/ha-myenergi/issues", - "requirements": ["pymyenergi==0.2.1"], - "version": "0.0.28" + "requirements": ["pymyenergi==0.2.2"], + "version": "0.0.29" } diff --git a/requirements_dev.txt b/requirements_dev.txt index 9cb7076..842c823 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -pre-commit==3.8.0 +pre-commit==4.0.1 black==24.8.0 flake8==7.1.1 homeassistant