JurajNyiri / HomeAssistant-Tapo-Control

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

Critical error when initializing H200 #482

Closed Exelord closed 6 months ago

Exelord commented 7 months ago

Description

With new Home Assistant update 2023.12 the integrations stopped working for H200 and C420 cameras.

When re-adding the hub, I am getting following issue:

2023-12-07 11:09:39.053 ERROR (MainThread) [homeassistant.config_entries] Error calling entry remove callback 192.168.1.41 for tapo_control
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 597, in async_remove
    await component.async_remove_entry(hass, self)
  File "/config/custom_components/tapo_control/__init__.py", line 277, in async_remove_entry
    coldDirPath = getColdDirPathForEntry(hass, entry_id)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo_control/utils.py", line 116, in getColdDirPathForEntry
    if hass.data[DOMAIN][entry_id]["mediaSyncColdDir"] is False:
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'mediaSyncColdDir'

Reproduction Steps

  1. Add new integration
  2. After confirming IP address the integration hangs.

Expected behavior

I does not fail

If applicable, add error logs.

No response

Device Firmware

1.2.23

Integration Version

5.4.12

Using stream component

No

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

HASOS

Search for similar issues

Yes

Additional information

No response

Exelord commented 6 months ago

Things are working again. Seams like HA updates fixed that.