Ludy87 / xplora_watch

Xplora® Watch Home Assistant Integration
MIT License
53 stars 6 forks source link

Silent switch is not created during setup #446

Open HACucoo opened 1 month ago

HACucoo commented 1 month ago

What version of Integration has the issue?

2.13.11

System Health details

System Information

version core-2024.10.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.46-haos
arch aarch64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4981 Installed Version | 2.0.1 Stage | running Available Repositories | 1431 Downloaded Repositories | 22
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 16. Oktober 2024 um 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | false remote_server | eu-central-1-16.ui.nabu.casa certificate_status | ready instance_id | e34fae38ae4e4ba1917143d72bf3acfe can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.09.1 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 28.0 GB disk_used | 7.2 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | green supervisor_api | ok version_api | ok installed_addons | Home Assistant Google Drive Backup (0.112.1), Terminal & SSH (9.15.0), Samba share (12.3.2), Mosquitto broker (6.4.1), RPC Shutdown (2.5), Fusion (2024.7.1)
Dashboards dashboards | 6 -- | -- resources | 12 views | 9 mode | storage
Recorder oldest_recorder_run | 28. September 2024 um 06:35 -- | -- current_recorder_run | 7. Oktober 2024 um 15:25 estimated_db_size | 143.45 MiB database_engine | sqlite database_version | 3.45.3
Xiaomi Miot Auto component_version | 0.7.20 -- | -- can_reach_server | ok can_reach_spec | ok logged_accounts | 1 total_devices | 12

Checklist

Describe the issue

I'm having trouble with the "Silent" switch.

When first configuring the watch, I had 5 silents set up in the Xplora app (because my kid has different school end times each day). Only one of them showed up in Home Assistant as a switch entity.

I was trying to fix this by deleting all silent times in the app and setting up one generic one (8 - 16h). My thought process was to just automate enabling and disabling the silent switch since my HA knows about school and other holidays already.

My problem is that now NO silent switch is being set up at all. I've tried

I rebooted home assistant between every step.

How can I get it to set up the silent switch again?

Reproduction steps

  1. Delete silent switch entity
  2. Configure watch - no silent switch can be added from the sensor drop down
  3. Re-install through HACS - still no silent sensor

Debug logs

2024-10-07 15:28:57.799 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to scandir with args (21,) inside the event loop by custom integration 'xplora_watch' at custom_components/xplora_watch/helper.py, line 110: shutil.rmtree(f"{dst_path}/emojis") (offender: /usr/local/lib/python3.12/shutil.py, line 686: with os.scandir(topfd) as scandir_it:), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir
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 189, 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/config_entries.py", line 742, in async_setup_locked
    await self.async_setup(hass, integration=integration)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/xplora_watch/__init__.py", line 62, in async_setup_entry
    move_emojis_directory(hass)
  File "/config/custom_components/xplora_watch/helper.py", line 110, in move_emojis_directory
    shutil.rmtree(f"{dst_path}/emojis")

2024-10-07 15:28:57.842 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'xplora_watch' calls async_forward_entry_setup for integration, xplora_watch with title: Xplora® and entry_id: 01J9KJP7DTFV1GNBKPEGMMRKB2, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/xplora_watch/__init__.py, line 67: hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, platform)), please create a bug report at https://github.com/Ludy87/xplora_watch/issues
2024-10-07 15:28:57.947 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J9KJP7DTFV1GNBKPEGMMRKB2, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (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 189, 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/config_entries.py", line 2223, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1192, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 155, in report
    _LOGGER.warning(msg, stack_info=True)
2024-10-07 15:28:57.956 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J9KJP7DTFV1GNBKPEGMMRKB2, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (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 189, 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/config_entries.py", line 2223, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1192, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 155, in report
    _LOGGER.warning(msg, stack_info=True)
2024-10-07 15:28:57.972 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J9KJP7DTFV1GNBKPEGMMRKB2, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (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 189, 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/config_entries.py", line 2223, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1192, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 155, in report
    _LOGGER.warning(msg, stack_info=True)
2024-10-07 15:28:57.992 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration xplora_watch with title: Xplora® and entry_id: 01J9KJP7DTFV1GNBKPEGMMRKB2, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (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 189, 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/config_entries.py", line 2223, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1192, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 155, in report
    _LOGGER.warning(msg, stack_info=True)
github-actions[bot] commented 1 month ago

:wave: @HACucoo, it is checked whether there is a bug. Please have some patience. This action was performed automatically.

github-actions[bot] commented 1 month ago

Thanks for opening this issue! I have applied any labels matching special text in your title and description.

@Ludy87: Please review the labels and make any necessary changes.