bimmerconnected / ha_custom_component

Home Assistant Custom Component of BMW Connected Drive
34 stars 13 forks source link

'str' object has no attribute 'read_only' #3

Closed aheath70 closed 4 years ago

aheath70 commented 4 years ago

I am using the custom component, and it appears to be logging in and retrieving data perfectly.

I am getting the following when trying to call any of the services such as light_flash, sound_horn, activate_air_conditioning.

2020-10-23 13:24:43 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.1773097480] 'str' object has no attribute 'read_only'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 138, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1374, in _execute_service
    await self._hass.async_add_executor_job(handler.func, service_call)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/bmw_connected_drive/__init__.py", line 200, in execute_service
    for account in filter(lambda account: not account.read_only, hass.data[DOMAIN]):
  File "/config/custom_components/bmw_connected_drive/__init__.py", line 200, in <lambda>
    for account in filter(lambda account: not account.read_only, hass.data[DOMAIN]):
AttributeError: 'str' object has no attribute 'read_only'
rikroe commented 4 years ago

~The new release should fix this, please try out! https://github.com/bimmerconnected/ha_custom_component/releases/tag/20201023.1~

Forget what I wrote - doesn't work on my machine. Although I was so sure this was the reason. Need to debug tonight and get you a fix.

aheath70 commented 4 years ago

No rush. I don't have any pressing urgency for these services, just thought I would let you know so that when it does get included into the HA general release it is hopefully working. Just glad I am now getting the other sensors and the ability to lock and unlock, which all work perfectly.

rikroe commented 4 years ago

Please try again. Works for my car now, at least :) https://github.com/bimmerconnected/ha_custom_component/releases/tag/20201023.3

aheath70 commented 4 years ago

Works for my car as well now. Thanks for your work - awesome stuff!