Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8e0067a1e | ||
|
|
45e65f384b | ||
|
|
df6b45621e | ||
|
|
1244bffcb4 | ||
|
|
d323cbfd11 | ||
|
|
2accec2b49 | ||
|
|
6b343a76ca | ||
|
|
fa2e06dcf4 | ||
|
|
c04d6b7bf8 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,7 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
<!--next-version-placeholder-->
|
<!--next-version-placeholder-->
|
||||||
## 2025.4.0 (2025-04-0)
|
## 2025.4.3 (2025-04-15)
|
||||||
|
### Fix
|
||||||
|
* Changes to how the sensors are stored to solve the issue where only one device is added, thanks [`@MarjovanLier`](https://github.com/MarjovanLier). ([`1244bff`](https://github.com/ryanbdclark/owlet/commit/1244bffcb48d7337a9d7a0da518959fe4b31a230))
|
||||||
|
|
||||||
|
## 2025.4.2 (2025-04-14)
|
||||||
|
### Fix
|
||||||
|
* Bumping pyowletapi to 2025.4.1, should hopefully stop issue where only one device was added to HA. ([`d323cbf`](https://github.com/ryanbdclark/owlet/commit/d323cbfd11411ff34866ead492de10c109c72689))
|
||||||
|
|
||||||
|
## 2025.4.1 (2025-04-11)
|
||||||
|
### Fix
|
||||||
|
* Changes to stop errors after refactoring pyowletapi ([`6b343a7`](https://github.com/ryanbdclark/owlet/commit/6b343a76caad3375e10c80f4d26942a1bbbb831d))
|
||||||
|
|
||||||
|
## 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))
|
||||||
|
|
||||||
|
|||||||
@@ -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".
|
||||||
|
|
||||||
|
|||||||
@@ -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"]}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -106,11 +106,11 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
sensors = []
|
sensors = []
|
||||||
for coordinator in coordinators:
|
for coordinator in coordinators:
|
||||||
sensors = [
|
sensors.extend([
|
||||||
OwletBinarySensor(coordinator, sensor)
|
OwletBinarySensor(coordinator, sensor)
|
||||||
for sensor in SENSORS
|
for sensor in SENSORS
|
||||||
if sensor.key in coordinator.sock.properties
|
if sensor.key in coordinator.sock.properties
|
||||||
]
|
])
|
||||||
|
|
||||||
if OwletAwakeSensor.entity_description.key in coordinator.sock.properties:
|
if OwletAwakeSensor.entity_description.key in coordinator.sock.properties:
|
||||||
sensors.append(OwletAwakeSensor(coordinator))
|
sensors.append(OwletAwakeSensor(coordinator))
|
||||||
|
|||||||
@@ -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}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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"]},
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class OwletBaseEntity(CoordinatorEntity[OwletCoordinator], Entity):
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the base entity."""
|
"""Initialize the base entity."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
|
self.coordinator = coordinator
|
||||||
self.sock = coordinator.sock
|
self.sock = coordinator.sock
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -26,9 +27,12 @@ class OwletBaseEntity(CoordinatorEntity[OwletCoordinator], Entity):
|
|||||||
"""Return the device info of the device."""
|
"""Return the device info of the device."""
|
||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
identifiers={(DOMAIN, self.sock.serial)},
|
identifiers={(DOMAIN, self.sock.serial)},
|
||||||
name="Owlet Baby Care Sock",
|
name=f"Owlet Sock {self.sock.serial}",
|
||||||
manufacturer=MANUFACTURER,
|
connections={("mac", getattr(self.sock, "mac", "unknown"))},
|
||||||
model=self.sock.model,
|
suggested_area="Nursery",
|
||||||
sw_version=self.sock.sw_version,
|
configuration_url="https://my.owletcare.com/",
|
||||||
hw_version=f"{self.sock.version}r{self.sock.revision}",
|
manufacturer="Owlet Baby Care",
|
||||||
|
model=getattr(self.sock, "model", None),
|
||||||
|
sw_version=getattr(self.sock, "sw_version", None),
|
||||||
|
hw_version=getattr(self.sock, "hw_version", "3r8"),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"issue_tracker": "https://github.com/ryanbdclark/owlet/issues",
|
"issue_tracker": "https://github.com/ryanbdclark/owlet/issues",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pyowletapi==2025.4.0"
|
"pyowletapi==2025.4.1"
|
||||||
],
|
],
|
||||||
"version": "2025.4.0"
|
"version": "2025.4.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,11 +115,11 @@ async def async_setup_entry(
|
|||||||
sensors = []
|
sensors = []
|
||||||
|
|
||||||
for coordinator in coordinators:
|
for coordinator in coordinators:
|
||||||
sensors = [
|
sensors.extend([
|
||||||
OwletSensor(coordinator, sensor)
|
OwletSensor(coordinator, sensor)
|
||||||
for sensor in SENSORS
|
for sensor in SENSORS
|
||||||
if sensor.key in coordinator.sock.properties
|
if sensor.key in coordinator.sock.properties
|
||||||
]
|
])
|
||||||
|
|
||||||
if OwletSleepSensor.entity_description.key in coordinator.sock.properties:
|
if OwletSleepSensor.entity_description.key in coordinator.sock.properties:
|
||||||
sensors.append(OwletSleepSensor(coordinator))
|
sensors.append(OwletSleepSensor(coordinator))
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
switches = []
|
switches = []
|
||||||
for coordinator in coordinators:
|
for coordinator in coordinators:
|
||||||
switches = [OwletBaseSwitch(coordinator, switch) for switch in SWITCHES]
|
switches.extend([OwletBaseSwitch(coordinator, switch) for switch in SWITCHES])
|
||||||
async_add_entities(switches)
|
async_add_entities(switches)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user