tronikos / default_config_disabler Goto Github PK
View Code? Open in Web Editor NEWDisables components from Home Assistant's default_config
Disables components from Home Assistant's default_config
Hi,
The following log appear in my journal :-)
I just follow the log instructions by creating an issue here...
Detected blocking call to open inside the event loop by custom integration 'default_config_disabler' at custom_components/default_config_disabler/helpers.py, line 38: with open(DEFAULT_CONFIG_MANIFEST_ORIGINAL, encoding="utf-8") as f: (offender: /mnt/dietpi_userdata/homeassistant/custom_components/default_config_disabler/helpers.py, line 38: with open(DEFAULT_CONFIG_MANIFEST_ORIGINAL, encoding="utf-8") as f:), please create a bug report at https://github.com/tronikos/default_config_disabler/issues Traceback (most recent call last): File "/home/homeassistant/.pyenv/versions/3.12.3/bin/hass", line 8, in <module> sys.exit(main()) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/asyncio/base_events.py", line 1987, in _run_once handle._run() File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/setup.py", line 447, in _async_setup_component await asyncio.gather( File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/setup.py", line 449, in <genexpr> create_eager_task( File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/config_entries.py", line 742, in async_setup_locked await self.async_setup(hass, integration=integration) File "/home/homeassistant/.pyenv/versions/3.12.3/lib/python3.12/site-packages/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/mnt/dietpi_userdata/homeassistant/custom_components/default_config_disabler/__init__.py", line 27, in async_setup_entry new_manifest = load_original_default_config_manifest() File "/mnt/dietpi_userdata/homeassistant/custom_components/default_config_disabler/helpers.py", line 38, in load_original_default_config_manifest with open(DEFAULT_CONFIG_MANIFEST_ORIGINAL, encoding="utf-8") as f: Detected blocking call to open inside the event loop by custom integration 'default_config_disabler' at custom_components/default_config_disabler/helpers.py, line 44: with open(DEFAULT_CONFIG_MANIFEST, encoding="utf-8") as f: (offender:
Cause
The open call is synchronous and is being executed in the asynchronous event loop. This causes the event loop to be blocked until the file operation is completed, which is not efficient and can lead to performance issues.
Solution
To fix this, you need to perform file I/O operations in an asynchronous manner. You can use aiofiles, an asynchronous file operations library, to avoid blocking the event loop.
My setup
Home assistant Core v2024.6.0
On the restart at the end of an update to HA 2023.11 (and on subsequent restarts), the following error is generated in the log.
Logger: homeassistant.setup
Source: setup.py:215
First occurred: 07:35:49 (1 occurrences)
Last logged: 07:35:49Setup failed for custom integration default_config_disabler: Unable to import component: cannot import name 'SERVICE_HOMEASSISTANT_RESTART' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
component = integration.get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 816, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/default_config_disabler/init.py", line 7, in
from homeassistant.const import SERVICE_HOMEASSISTANT_RESTART
ImportError: cannot import name 'SERVICE_HOMEASSISTANT_RESTART' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
Full log attached at home-assistant_2023-11-02T07-44-45.093Z.log
System information attached at system_information.txt (Raspberry Pi 4)
once ha updates the integration brakes and have to restart every time for this to work
Howdy,
I'm running 2024.8.0 and I have conversation set to disable, however, it's still enabled. I don't see anything in the logs indicating why it would fail.
please let me know if there's anything else I can provide.
After installation I get this error when trying to load it in the devices screen.
Config flow could not be loaded: {"message":"Invalid handler specified"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.