jonnybergdahl / HomeAssistant_Growcube_Integration

Elecrow Growcube integration for Home Assistant
14 stars 1 forks source link

Error with actions #8

Open goedh452 opened 2 months ago

goedh452 commented 2 months ago

When I try to perform an action (formerly known as services), I get an unhandled execution. Any ideas? The information is displayed correctly and pressing the buttons provided by the integration does water the plants.

Scherm­afbeelding 2024-08-18 om 14 27 22
Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:525
First occurred: 14:24:46 (1 occurrences)
Last logged: 14:24:46

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'tuple' object has no attribute 'handle_water_plant'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/growcube/services.py", line 24, in async_call_water_plant_service
    await _async_handle_water_plant(hass, service_call.data)
  File "/config/custom_components/growcube/services.py", line 122, in _async_handle_water_plant
    await coordinator.handle_water_plant(channel, duration)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'handle_water_plant'
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/growcube/services.py:122
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 14:24:46 (1 occurrences)
Last logged: 14:24:46

[139661396911600] Error handling message: Unknown error (unknown_error) Bouke from 192.168.2.2 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Safari/605.1.15)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, 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 1799, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/growcube/services.py", line 24, in async_call_water_plant_service
    await _async_handle_water_plant(hass, service_call.data)
  File "/config/custom_components/growcube/services.py", line 122, in _async_handle_water_plant
    await coordinator.handle_water_plant(channel, duration)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'handle_water_plant'
gianlucaromito commented 2 months ago

Hi I've got the similar error. It does NOT water the plant, using this method.

image

Translation Error: The intl string context variable "services" was not provided to the string "Impossibile eseguire l'azione: {services}" Unknown error

HASS: Core 2024.8.2 Supervisor 2024.08.0 Operating System 12.4 Frontend 20240809.0

Growcube da Elecrow Firmware: 4.1