diff --git a/custom_components/wyzeapi/__init__.py b/custom_components/wyzeapi/__init__.py index 948d7347..da11d3d2 100644 --- a/custom_components/wyzeapi/__init__.py +++ b/custom_components/wyzeapi/__init__.py @@ -137,6 +137,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b CONF_CLIENT: client, "key_id": KEY_ID, "api_key": API_KEY, + "coordinators": {}, } await setup_coordinators(hass, config_entry, client) diff --git a/custom_components/wyzeapi/lock.py b/custom_components/wyzeapi/lock.py index e8318247..afe4b98c 100644 --- a/custom_components/wyzeapi/lock.py +++ b/custom_components/wyzeapi/lock.py @@ -58,11 +58,17 @@ async def async_setup_entry( if lock.product_model != "YD_BT1" ] lock_bolts = [] + coordinators = hass.data[DOMAIN][config_entry.entry_id].get("coordinators", {}) for lock in all_locks: if lock.product_model == "YD_BT1": - coordinator = hass.data[DOMAIN][config_entry.entry_id]["coordinators"][ - lock.mac - ] + coordinator = coordinators.get(lock.mac) + if coordinator is None: + _LOGGER.warning( + "No coordinator found for Lock Bolt %s (%s), skipping", + lock.nickname, + lock.mac, + ) + continue lock_bolts.append(WyzeLockBolt(coordinator)) async_add_entities(locks + lock_bolts, True) diff --git a/pyproject.toml b/pyproject.toml index 051e9983..03aef554 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [project] name = "ha-wyzeapi" -version = "0.1.35" +version = "0.1.36" description = "A Home Assistant integration for Wyze devices" authors = [{ name = "Katie Mulliken", email = "katie@mulliken.net" }] license = { text = "Apache-2.0" } @@ -12,7 +12,7 @@ requires-python = ">=3.13.2,<3.14" dependencies = [ "homeassistant>=2025.5.0", - "wyzeapy>=0.5.30,<0.6.0", + "wyzeapy>=0.5.31,<0.6.0", ] [build-system]