3 Commits

Author SHA1 Message Date
RyanClark123
bd6a315b00 Bumping to pyowletapi 2023.5.25
#### Fix
* Bumping to pyowletapi 2023.5.25
2023-05-17 19:23:37 +01:00
RyanClark123
0cf3afef85 Bumping pyowlet, reauth config entry fix
#### Fix
* Bumping to pyowletapi 2023.5.24
* Reauthing now no longer re adds users' password to config entry
2023-05-17 18:59:38 +01:00
ryanbdclark
fa06157fe2 Update const.py
###Fix
* Error in sleep states constant corrected
2023-05-16 21:14:46 +01:00
5 changed files with 16 additions and 10 deletions

View File

@@ -1,6 +1,15 @@
# Changelog # Changelog
<!--next-version-placeholder--> <!--next-version-placeholder-->
## 2023-05-4 (2023-05-17)
#### Fix
* Bumping to pyowletapi 2023.5.25
## 2023-05-3 (2023-05-17)
#### Fix
* Bumping to pyowletapi 2023.5.24
* Reauthing now no longer re adds users' password to config entry
## 2023-05-2 (2023-05-16) ## 2023-05-2 (2023-05-16)
#### Feature #### Feature
* Integration now makes use of refresh token from pyowletapi to reauthenticate, user password in no longer stored by integration ([`dc710a1`](https://github.com/ryanbdclark/owlet/commit/dc710a1783a4cad9d6cf355240fe12ac779a87ef)) * Integration now makes use of refresh token from pyowletapi to reauthenticate, user password in no longer stored by integration ([`dc710a1`](https://github.com/ryanbdclark/owlet/commit/dc710a1783a4cad9d6cf355240fe12ac779a87ef))

View File

@@ -138,12 +138,9 @@ class OwletConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
try: try:
token = await owlet_api.authenticate() token = await owlet_api.authenticate()
if token: if token:
user_input[CONF_API_TOKEN] = token[CONF_API_TOKEN] self.hass.config_entries.async_update_entry(
user_input[CONF_OWLET_EXPIRY] = token[CONF_OWLET_EXPIRY] self.reauth_entry, data={**entry_data, **token}
user_input[CONF_OWLET_REFRESH] = token[CONF_OWLET_REFRESH] )
self.hass.config_entries.async_update_entry(
self.reauth_entry, data={**entry_data, **user_input}
)
await self.hass.config_entries.async_reload(self.reauth_entry.entry_id) await self.hass.config_entries.async_reload(self.reauth_entry.entry_id)

View File

@@ -8,4 +8,4 @@ CONF_OWLET_REFRESH = "refresh"
SUPPORTED_VERSIONS = [3] SUPPORTED_VERSIONS = [3]
POLLING_INTERVAL = 5 POLLING_INTERVAL = 5
MANUFACTURER = "Owlet Baby Care" MANUFACTURER = "Owlet Baby Care"
SLEEP_STATES = {1, "Awake", 8, "Light Sleep", 15, "Deep Sleep"} SLEEP_STATES = {0: "Unknown", 1: "Awake", 8: "Light Sleep", 15: "Deep Sleep"}

View File

@@ -10,7 +10,7 @@
"homekit": {}, "homekit": {},
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"requirements": [ "requirements": [
"pyowletapi==2023.5.23" "pyowletapi==2023.5.25"
], ],
"version":"2023.5.2" "version":"2023.5.4"
} }

View File

@@ -170,4 +170,4 @@ class OwletSleepStateSensor(OwletBaseEntity, SensorEntity):
@property @property
def options(self) -> list[str]: def options(self) -> list[str]:
return ["Awake", "Light Sleep", "Deep Sleep"] return SLEEP_STATES.values()