Giter VIP home page Giter VIP logo

default_config_disabler's People

Contributors

tronikos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

default_config_disabler's Issues

asynchronous file operations needed

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

Restart after 2023.11 update fails to import SERVICE_HOMEASSISTANT_RESTART

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:49

Setup 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)

every update

once ha updates the integration brakes and have to restart every time for this to work

2024.8.0 can't disable conversation

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.