lkempf/casambi-bt-hass

Scenes not working in 0.1.1

Closed this issue · 1 comments

Describe the bug
Since upgrading to 0.1.1, all casambi scenes are not working anymore. The scenes are imported correctly from the casambi network, but when activating a scene in HomeAssistant, i get the following error message:

Fehler beim Aufrufen des Diensts scene/turn_on. 'CasambiScene' object has no attribute 'scene'

It was working on 0.1.0

(The blinds of the pergola do act as a casambi light device)

To Reproduce
Steps to reproduce the behavior:

  1. Activate a scene
  2. Error message appears

Expected behavior
Casambi scenes can be activated in HA as it was working before in 0.1.0

Screenshots
casambi-bt-bug

Versions

  • HA version: 2024.3.1
  • Integration version: 0.1.1

Logs

2024-03-15 09:12:14.408 INFO (MainThread) [custom_components.casambi_bt.scene] Switching to scene Lamellen offen
2024-03-15 09:12:14.413 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472578982464] 'CasambiScene' object has no attribute 'scene'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/scene/__init__.py", line 114, in _async_activate
    await self.async_activate(**kwargs)
  File "/config/custom_components/casambi_bt/scene.py", line 50, in async_activate
    await self._api.casa.switchToScene(self.scene, brightness)
                                       ^^^^^^^^^^
AttributeError: 'CasambiScene' object has no attribute 'scene'

I've proposed a fix here:
#76

I've deployed this on my Home Assistant and it works :)