diff --git a/CHANGELOG.md b/CHANGELOG.md index ab61d12..21f7d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ # Changelog -## 2025.4.0 (2025-04-0) +## 2025.4.1 (2025-04-11) +### Fix +* Changes to stop errors after refactoring pyowletapi + +## 2025.4.0 (2025-04-11) ### Fix * Bumping pyowletapi to 2025.4.0 diff --git a/custom_components/owlet/__init__.py b/custom_components/owlet/__init__.py index ca05453..a6f93f1 100644 --- a/custom_components/owlet/__init__.py +++ b/custom_components/owlet/__init__.py @@ -68,7 +68,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER.error("No owlet devices found to set up") return False - if devices["tokens"]: + if "tokens" in devices: hass.config_entries.async_update_entry( entry, data={**entry.data, **devices["tokens"]} ) diff --git a/custom_components/owlet/config_flow.py b/custom_components/owlet/config_flow.py index 5c81c15..6010b39 100644 --- a/custom_components/owlet/config_flow.py +++ b/custom_components/owlet/config_flow.py @@ -125,8 +125,7 @@ class OwletConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): session=async_get_clientsession(self.hass), ) try: - token = await owlet_api.authenticate() - if token: + if token := await owlet_api.authenticate(): self.hass.config_entries.async_update_entry( self.reauth_entry, data={**entry_data, **token} ) diff --git a/custom_components/owlet/coordinator.py b/custom_components/owlet/coordinator.py index 889c063..4553020 100644 --- a/custom_components/owlet/coordinator.py +++ b/custom_components/owlet/coordinator.py @@ -42,7 +42,7 @@ class OwletCoordinator(DataUpdateCoordinator): """Fetch the data from the device.""" try: properties = await self.sock.update_properties() - if properties["tokens"]: + if "tokens" in properties: self.hass.config_entries.async_update_entry( self.config_entry, data={**self.config_entry.data, **properties["tokens"]}, diff --git a/custom_components/owlet/manifest.json b/custom_components/owlet/manifest.json index 1629ed1..ab0455d 100644 --- a/custom_components/owlet/manifest.json +++ b/custom_components/owlet/manifest.json @@ -11,5 +11,5 @@ "requirements": [ "pyowletapi==2025.4.0" ], - "version": "2025.4.0" + "version": "2025.4.1" }