HA 2025.6 Haier integration not working
I have updated HA to version 2025.6. Integration is not loading. It is completely broken.
Logger: homeassistant.bootstrap Zdroj: bootstrap.py:999 První výskyt: 06:37:13 (1 výskyt) Naposledy logováno: 06:37:13
Waiting on integrations to complete setup: {('hon', '01JWC38FGT3G8FQ9W1VKT10KY1'): 4386161.504713396}
Logger: homeassistant.util.loop Zdroj: util/loop.py:137 První výskyt: 06:36:55 (6 výskytů) Naposledy logováno: 06:37:38
Detected blocking call to read_text with args (PosixPath('/usr/local/lib/python3.13/site-packages/jaraco/text/Lorem ipsum.txt'),) inside the event loop by custom integration 'hon' at custom_components/hon/init.py, line 34: hon = await Hon( (offender: /usr/local/lib/python3.13/site-packages/jaraco/text/init.py, line 233: files(name).joinpath('Lorem ipsum.txt').read_text(encoding='utf-8')), please create a bug report at https://github.com/Andre0512/hon/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#read_text Traceback (most recent call last): File "
same here
same problem here :(
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/init.py", line 58, in async_setup_entry hass.config_entries.async_forward_entry_setup(entry, platform) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'ConfigEntries' object has no attribute 'async_forward_entry_setup'. Did you mean: 'async_forward_entry_setups'?
I get this error
Same problem.
I noticed the same issue...
https://github.com/Andre0512/hon/issues/303#issuecomment-2967595278
change this
for platform in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setups(entry, platform)
)
to
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
in custom_components/hon/__init__.py
Many thanks @ugkhan21 ! Now it works!
change this
for platform in PLATFORMS: hass.async_create_task( hass.config_entries.async_forward_entry_setups(entry, platform) )to
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)in
custom_components/hon/__init__.py
This is not work for me, the integration loads the sensors, but fails at te moment
My resolution: https://github.com/Andre0512/hon/issues/303#issuecomment-2968229369
Next i'll copy paste my modified "custom_components/hon/init.py" file.
The errore I got is still the same as before:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hon/init.py", line 58, in async_setup_entry hass.config_entries.async_forward_entry_setup(entry, PLATFORMS) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'ConfigEntries' object has no attribute 'async_forward_entry_setup'. Did you mean: 'async_forward_entry_setups'?
import logging from pathlib import Path from typing import Any
import voluptuous as vol # type: ignore[import-untyped] from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from homeassistant.helpers import config_validation as cv, aiohttp_client from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from pyhon import Hon
from .const import DOMAIN, PLATFORMS, MOBILE_ID, CONF_REFRESH_TOKEN
_LOGGER = logging.getLogger(name)
HON_SCHEMA = vol.Schema( { vol.Required(CONF_EMAIL): cv.string, vol.Required(CONF_PASSWORD): cv.string, } )
CONFIG_SCHEMA = vol.Schema( {DOMAIN: vol.Schema(vol.All(cv.ensure_list, [HON_SCHEMA]))}, extra=vol.ALLOW_EXTRA, )
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool: session = aiohttp_client.async_get_clientsession(hass) if (config_dir := hass.config.config_dir) is None: raise ValueError("Missing Config Dir") hon = await Hon( email=entry.data[CONF_EMAIL], password=entry.data[CONF_PASSWORD], mobile_id=MOBILE_ID, session=session, test_data_path=Path(config_dir), refresh_token=entry.data.get(CONF_REFRESH_TOKEN, ""), ).create()
# Save the new refresh token
hass.config_entries.async_update_entry(
entry, data={**entry.data, CONF_REFRESH_TOKEN: hon.api.auth.refresh_token}
)
coordinator: DataUpdateCoordinator[dict[str, Any]] = DataUpdateCoordinator(
hass, _LOGGER, name=DOMAIN
)
hon.subscribe_updates(coordinator.async_set_updated_data)
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.unique_id] = {"hon": hon, "coordinator": coordinator}
for platform in PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, PLATFORMS)
)
return True
async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool: refresh_token = hass.data[DOMAIN][entry.unique_id]["hon"].api.auth.refresh_token
hass.config_entries.async_update_entry(
entry, data={**entry.data, CONF_REFRESH_TOKEN: refresh_token}
)
unload = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload:
if not hass.data[DOMAIN]:
hass.data.pop(DOMAIN, None)
return unload
The fix worked fine for me in hon (and also govee plugin). @snattanzi Did you restart HA after saving changes to the file? I believe it is a necessary step for HA to pick up the changes, simple plugin reload didn't work for me.
The fix worked fine for me in hon (and also govee plugin). @snattanzi Did you restart HA after saving changes to the file? I believe it is a necessary step for HA to pick up the changes, simple plugin reload didn't work for me.
Just to confirm, you definitely do need to restart HA after applying the fix - it didn't work for me until I did so.
@B4rt0 I did restart but nothing worked for me. Then I double checked the code and modified again the yaml. Now it seems to work. This is the code of my init
"""The Candy integration.""" from future import annotations
import logging from datetime import timedelta
import async_timeout
from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .client import CandyClient, WashingMachineStatus
from .const import *
_LOGGER = logging.getLogger(name)
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Set up Candy from a config entry."""
ip_address = config_entry.data[CONF_IP_ADDRESS]
encryption_key = config_entry.data.get(CONF_PASSWORD, "")
use_encryption = config_entry.data.get(CONF_KEY_USE_ENCRYPTION, True)
session = async_get_clientsession(hass)
client = CandyClient(session, ip_address, encryption_key, use_encryption)
async def update_status():
try:
async with async_timeout.timeout(40):
status = await client.status_with_retry()
_LOGGER.debug("Fetched status: %s", status)
return status
except Exception as err:
raise UpdateFailed(f"Error communicating with API: {repr(err)}") from err
coordinator = DataUpdateCoordinator(
hass,
_LOGGER,
name=DOMAIN,
update_interval=timedelta(seconds=60),
update_method=update_status,
)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = {
DATA_KEY_COORDINATOR: coordinator
}
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: del hass.data[DOMAIN]
return unload_ok
@B4rt0 I did restart but nothing worked for me. Then I double checked the code and modified again the yaml. Now it seems to work. This is the code of my init
"""The Candy integration.""" from future import annotations
import logging from datetime import timedelta
import async_timeout
from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .client import CandyClient, WashingMachineStatus
from .const import *
_LOGGER = logging.getLogger(name)
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool: """Set up Candy from a config entry."""
ip_address = config_entry.data[CONF_IP_ADDRESS] encryption_key = config_entry.data.get(CONF_PASSWORD, "") use_encryption = config_entry.data.get(CONF_KEY_USE_ENCRYPTION, True) session = async_get_clientsession(hass) client = CandyClient(session, ip_address, encryption_key, use_encryption) async def update_status(): try: async with async_timeout.timeout(40): status = await client.status_with_retry() _LOGGER.debug("Fetched status: %s", status) return status except Exception as err: raise UpdateFailed(f"Error communicating with API: {repr(err)}") from err coordinator = DataUpdateCoordinator( hass, _LOGGER, name=DOMAIN, update_interval=timedelta(seconds=60), update_method=update_status, ) await coordinator.async_config_entry_first_refresh() hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = { DATA_KEY_COORDINATOR: coordinator } await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS) return Trueasync def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) if unload_ok: del hass.data[DOMAIN]
return unload_ok
Can you post full code or init.py files? Thank you