4 Commits

Author SHA1 Message Date
RyanClark123
2accec2b49 Merge branch 'main' of https://github.com/ryanbdclark/owlet 2025-04-11 13:51:11 +01:00
RyanClark123
6b343a76ca Fix for errors after refactoring of api
### Fix
* Changes to stop errors after refactoring pyowletapi
2025-04-11 13:50:59 +01:00
ryanbdclark
fa2e06dcf4 Merge pull request #23 from jusso-dev/patch-1
Update README.md
2025-04-11 13:37:12 +01:00
Justin Middler
c04d6b7bf8 Update README.md 2025-04-01 15:01:19 +11:00
6 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,11 @@
# Changelog # Changelog
<!--next-version-placeholder--> <!--next-version-placeholder-->
## 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 ### Fix
* Bumping pyowletapi to 2025.4.0 ([`268365c`](https://github.com/ryanbdclark/owlet/commit/268365ccd428418dd5707f0569ce738b54a12fdd)) * Bumping pyowletapi to 2025.4.0 ([`268365c`](https://github.com/ryanbdclark/owlet/commit/268365ccd428418dd5707f0569ce738b54a12fdd))

View File

@@ -12,7 +12,7 @@ A custom component for the Owlet smart sock
## Installation ## Installation
1. Use [HACS](https://hacs.xyz/docs/setup/download), in `HACS > Integrations > Explore & Add Repositories` search for "Owlet". 1. Use [HACS](https://hacs.xyz/docs/use/download/download/), in `HACS > Integrations > Explore & Add Repositories` search for "Owlet".
2. Restart Home Assistant. 2. Restart Home Assistant.
3. [![Add Integration][add-integration-badge]][add-integration] or in the HA UI go to "Settings" -> "Devices & Services" then click "+" and search for "Owlet Smart Sock". 3. [![Add Integration][add-integration-badge]][add-integration] or in the HA UI go to "Settings" -> "Devices & Services" then click "+" and search for "Owlet Smart Sock".

View File

@@ -68,7 +68,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_LOGGER.error("No owlet devices found to set up") _LOGGER.error("No owlet devices found to set up")
return False return False
if devices["tokens"]: if "tokens" in devices:
hass.config_entries.async_update_entry( hass.config_entries.async_update_entry(
entry, data={**entry.data, **devices["tokens"]} entry, data={**entry.data, **devices["tokens"]}
) )

View File

@@ -125,8 +125,7 @@ class OwletConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
session=async_get_clientsession(self.hass), session=async_get_clientsession(self.hass),
) )
try: try:
token = await owlet_api.authenticate() if token := await owlet_api.authenticate():
if token:
self.hass.config_entries.async_update_entry( self.hass.config_entries.async_update_entry(
self.reauth_entry, data={**entry_data, **token} self.reauth_entry, data={**entry_data, **token}
) )

View File

@@ -42,7 +42,7 @@ class OwletCoordinator(DataUpdateCoordinator):
"""Fetch the data from the device.""" """Fetch the data from the device."""
try: try:
properties = await self.sock.update_properties() properties = await self.sock.update_properties()
if properties["tokens"]: if "tokens" in properties:
self.hass.config_entries.async_update_entry( self.hass.config_entries.async_update_entry(
self.config_entry, self.config_entry,
data={**self.config_entry.data, **properties["tokens"]}, data={**self.config_entry.data, **properties["tokens"]},

View File

@@ -11,5 +11,5 @@
"requirements": [ "requirements": [
"pyowletapi==2025.4.0" "pyowletapi==2025.4.0"
], ],
"version": "2025.4.0" "version": "2025.4.1"
} }