JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
968 stars 81 forks source link

Camera: 'bool' object is not subscriptable #428

Closed vdiogo closed 9 months ago

vdiogo commented 9 months ago

Description

I get the following error multiple times during the day: Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptable

I have not identified lack of connection with the cameras when I need to display them in home assistant

Reproduction Steps

Go to Configuration --> System --> Logs

Expected behavior

Would not expect this error to display

If applicable, add error logs.

Este erro teve origem numa integração personalizada.

Logger: custom_components.tapo_control
Source: helpers/update_coordinator.py:290
Integration: Tapo: Cameras Control (documentation, issues)
First occurred: 17 de outubro de 2023 às 18:53:21 (17 occurrences)
Last logged: 08:29:26

Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 246, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo_control/__init__.py", line 434, in async_update_data
    entity["entity"].updateTapo(
  File "/config/custom_components/tapo_control/sensor.py", line 130, in updateTapo
    if len(camData["sdCardData"]) > 0:
           ~~~~~~~^^^^^^^^^^^^^^
TypeError: 'bool' object is not subscriptable

Device Firmware

1.3.6 Build 230424 Rel.77225n(4555)

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Home Assistant Supervised

Search for similar issues

Yes

Additional information

Looks similar to https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/393

JurajNyiri commented 9 months ago

Please enable debug logs.

logger:
  default: critical
  logs:
    custom_components.tapo_control: debug

Upload the full log here once the error happens.

JurajNyiri commented 9 months ago

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.3.9.