Skip to content

Commit

Permalink
Fix #428: Error TypeError: 'bool' object is not subscriptable when ca…
Browse files Browse the repository at this point in the history
…mera unavailable
  • Loading branch information
JurajNyiri committed Oct 18, 2023
1 parent 8260b75 commit 99bec38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/tapo_control/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async def async_update(self) -> None:

def updateTapo(self, camData):
state = STATE_UNAVAILABLE
if len(camData["sdCardData"]) > 0:
if camData and "sdCardData" in camData and len(camData["sdCardData"]) > 0:
for hdd in camData["sdCardData"]:
if hdd["disk_name"] == self._sensor_name:
state = hdd[self._sensor_property]
Expand Down

0 comments on commit 99bec38

Please sign in to comment.