SonoffLAN icon indicating copy to clipboard operation
SonoffLAN copied to clipboard

Update to new core on Home Assistant 2024.5.0 created a new issue

Open lordwizzard opened this issue 1 year ago • 3 comments

Core 2024.5.0 Supervisor 2024.04.4 Operating System 12.2 Frontend 20240501.0

Changes made in Home Assistant update today created this new issue:

Logger: homeassistant.helpers.frame Source: helpers/frame.py:190 First occurred: 4:57:07 PM (3 occurrences) Last logged: 4:57:18 PM

Detected that custom integration 'sonoff' accesses hass.helpers.system_info. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from system_info directly at custom_components/sonoff/system_health.py, line 61: info = await hass.helpers.system_info.async_get_system_info(), please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues

lordwizzard avatar May 02 '24 01:05 lordwizzard

Just so more info, that the update was to Home Assistant Core 2024.5.0 and today there is another upgrade to Home Assistant Core to 2024.5.1 and the issue is there.

lordwizzard avatar May 03 '24 22:05 lordwizzard

I lost all my SonOff devices. Everything came back after restoring from 2024.5.2 to 2024.4.4

I guess I'll just add a backup/restore step to my core installs untill it is fixed ...

MilanGajicBuva avatar May 08 '24 21:05 MilanGajicBuva

It´s works. 2024.5.5 updated OK.

apardillos avatar May 29 '24 14:05 apardillos

Hello, i still have this error in 2024.7.1 :

2024-07-07 18:31:07.053 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'sonoff' accesses hass.helpers.system_info. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from system_info directly at custom_components/sonoff/system_health.py, line 61: info = await hass.helpers.system_info.async_get_system_info(), please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues
2024-07-07 18:31:07.062 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to walk with args ('/config/custom_components/sonoff',) inside the event loop by custom integration 'sonoff' at custom_components/sonoff/core/xutils.py, line 14: for root, dirs, files in os.walk(path): (offender: /config/custom_components/sonoff/core/xutils.py, line 14: for root, dirs, files in os.walk(path):), please create a bug report at https://github.com/AlexxIT/SonoffLAN/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 167, in async_setup_component
    result = await _async_setup_component(hass, domain, config)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in _async_setup_component
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/setup.py", line 451, in <genexpr>
    create_eager_task(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task
    return Task(coro, loop=loop, name=name, eager_start=True)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 734, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/sonoff/__init__.py", line 170, in async_setup_entry
    await system_health.setup_debug(hass, _LOGGER)
  File "/config/custom_components/sonoff/system_health.py", line 62, in setup_debug
    info[DOMAIN + "_version"] = f"{integration.version} ({xutils.source_hash()})"
  File "/config/custom_components/sonoff/core/xutils.py", line 14, in source_hash
    for root, dirs, files in os.walk(path):

anything to deal with please?

Electronlibre2012 avatar Jul 07 '24 14:07 Electronlibre2012

So to fix this in your HA install:

Go into HACS, find the Sonoff package in the list of HACS packages, click on the 3 dots in the upper right corner, Do the"redownload", once it has redownloaded the package you will be prompted to restart HA in the left hand menu. This actually pulls a new copy that has the merged patches (fixes) in place.

YMMV due to other changes in the core HA updates that come out weekly. But it takes care of this one!

Thanks to @hmmbob for his work!

lordwizzard avatar Jul 09 '24 02:07 lordwizzard

Work now

lordwizzard avatar Jul 09 '24 02:07 lordwizzard

thank you both!

Electronlibre2012 avatar Jul 09 '24 04:07 Electronlibre2012