schmittx / home-assistant-eero

Eero integration for Home Assistant
MIT License
108 stars 22 forks source link

Reboot Buttons not functioning #63

Closed jeffmckee closed 1 year ago

jeffmckee commented 1 year ago

When I "Press" the "Reboot" buttons for a node it returns the following error: "Failed to call service button/press. connection lost". When I look in the Home Assistant logs it says:


This error originated from a custom integration.

Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/eero/button.py:92
Integration: eero (documentation, issues)
First occurred: 2:05:16 PM (1 occurrences)
Last logged: 2:05:16 PM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'EeroButtonEntity' object has no attribute 'key'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 703, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 665, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1957, in a
```sync_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 1997, in _execute_service
    return await cast(
           ^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 845, in entity_service_call
    response_data = task.result()  # pop exception if have
                    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 889, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 124, in _async_press_action
    await self.async_press()
  File "/config/custom_components/eero/button.py", line 96, in async_press
    await super().async_press()
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 139, in async_press
    await self.hass.async_add_executor_job(self.press)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eero/button.py", line 92, in press
    getattr(self.resource, self.key)()
                           ^^^^^^^^
AttributeError: 'EeroButtonEntity' object has no attribute 'key'
schmittx commented 1 year ago

This is fixed in 1.4.2, please update and confirm.

jeffmckee commented 1 year ago

Seems to work. Thanks so much, @schmittx!