mdeweerd / zha-toolkit

🧰 Zigbee Home Assistant Toolkit - service for "rare" Zigbee operations using ZHA on Home Assistant
GNU General Public License v3.0
171 stars 17 forks source link

Traceback when triggering OTA #225

Open systemcrash opened 2 months ago

systemcrash commented 2 months ago

Not sure where the problem is rooted. Ran under HA core 2024.05.0

2024-05-03 16:03:56.194 ERROR (MainThread) [custom_components.zha_toolkit] Exception ''OTA' object has no attribute '_listeners'' for service call with data '{'zha_toolkit_version': 'v1.1.10', 'zigpy_version': '0.64.0', 'zigpy_rf_version': '0.23.1', 'ieee_org': 'light.kitchen_ceiling_mid_mid_light', 'ieee': '5c:c7:c1:ff:fe:16:d2:16', 'command': 'ota_notify', 'command_data': None, 'start_time': '2024-05-03T16:03:56.141460+00:00', 'errors': ['AttributeError("\'OTA\' object has no attribute \'_listeners\'")'], 'params': {'dir': 0, 'tries': 1, 'expect_reply': True, 'args': [], 'read_before_write': True, 'read_after_write': True}, 'PAR': {'cmd_id': None, 'endpoint_id': None, 'dst_endpoint_id': None, 'cluster_id': None, 'attr_id': None, 'attr_type': None, 'attr_val': None, 'code': None, 'min_interval': None, 'max_interval': None, 'reportable_change': None, 'dir': 0, 'manf': None, 'tries': 1, 'expect_reply': True, 'args': [], 'state_id': None, 'state_attr': None, 'state_value_template': None, 'force_update': False, 'allow_create': False, 'event_success': None, 'event_fail': None, 'event_done': None, 'fail_exception': False, 'read_before_write': True, 'read_after_write': True, 'write_if_equal': False, 'csvfile': None, 'csvlabel': None, 'download': None, 'path': None, 'use_cache': False}, 'success': False}'
2024-05-03 16:03:56.194 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'OTA' object has no attribute '_listeners'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 825, in toolkit_service
    raise handler_exception
  File "/config/custom_components/zha_toolkit/__init__.py", line 781, in toolkit_service
    handler_result = await handler(
                     ^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 891, in command_handler_default
    return await default.default(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/default.py", line 40, in default
    await handler(app, listener, ieee, cmd, data, service, params, event_data)
  File "/config/custom_components/zha_toolkit/ota.py", line 210, in ota_notify
    await ota_update_images(
  File "/config/custom_components/zha_toolkit/ota.py", line 181, in ota_update_images
    for _, (ota, _) in app.ota._listeners.items():
                       ^^^^^^^^^^^^^^^^^^
AttributeError: 'OTA' object has no attribute '_listeners'
2024-05-03 16:03:56.732 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140580263171648] Error handling message: Unknown error (unknown_error) Paul from 192.168.19.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
    script_result = await script_obj.async_run(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1731, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 503, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 533, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 501, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 736, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 699, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 825, in toolkit_service
    raise handler_exception
  File "/config/custom_components/zha_toolkit/__init__.py", line 781, in toolkit_service
    handler_result = await handler(
                     ^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/__init__.py", line 891, in command_handler_default
    return await default.default(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/zha_toolkit/default.py", line 40, in default
    await handler(app, listener, ieee, cmd, data, service, params, event_data)
  File "/config/custom_components/zha_toolkit/ota.py", line 210, in ota_notify
    await ota_update_images(
  File "/config/custom_components/zha_toolkit/ota.py", line 181, in ota_update_images
    for _, (ota, _) in app.ota._listeners.items():
                       ^^^^^^^^^^^^^^^^^^
AttributeError: 'OTA' object has no attribute '_listeners'