marcelwestrahome / home-assistant-niu-component

niu scooter integration for Home assistant.
Apache License 2.0
47 stars 30 forks source link

dataTrack - TypeError: 'bool' object is not subscriptable #37

Closed fjluquerodriguez closed 2 years ago

fjluquerodriguez commented 2 years ago

Hi. I've installed the component and configured it. I receive this error when it inits:

2022-08-01 13:38:35 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up niu platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/niu/sensor.py", line 392, in setup_platform
    NiuSensor(
  File "/config/custom_components/niu/sensor.py", line 503, in __init__
    self._state = self._data_bridge.dataTrack(self._id_name)
  File "/config/custom_components/niu/sensor.py", line 436, in dataTrack
    (self._dataTrackInfo["data"][0][id_field]) / 1000
TypeError: 'bool' object is not subscriptable
fjluquerodriguez commented 2 years ago

I'm debugging: image Translate: "This operation requires owner permission"

syssi commented 2 years ago

It looks like the API has changed?

fjluquerodriguez commented 2 years ago

I don't know. If i remove LastTrack sensors it works fine...