mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Bump pyeight to 0.3.0 (#73151)
This commit is contained in:
parent
05e5dd7baf
commit
16bf6903bd
@ -63,9 +63,10 @@ CONFIG_SCHEMA = vol.Schema(
|
||||
|
||||
def _get_device_unique_id(eight: EightSleep, user_obj: EightUser | None = None) -> str:
|
||||
"""Get the device's unique ID."""
|
||||
unique_id = eight.deviceid
|
||||
unique_id = eight.device_id
|
||||
assert unique_id
|
||||
if user_obj:
|
||||
unique_id = f"{unique_id}.{user_obj.userid}.{user_obj.side}"
|
||||
unique_id = f"{unique_id}.{user_obj.user_id}.{user_obj.side}"
|
||||
return unique_id
|
||||
|
||||
|
||||
@ -133,9 +134,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
|
||||
for sens in sensor:
|
||||
side = sens.split("_")[1]
|
||||
userid = eight.fetch_userid(side)
|
||||
usrobj = eight.users[userid]
|
||||
await usrobj.set_heating_level(target, duration)
|
||||
user_id = eight.fetch_user_id(side)
|
||||
assert user_id
|
||||
usr_obj = eight.users[user_id]
|
||||
await usr_obj.set_heating_level(target, duration)
|
||||
|
||||
await heat_coordinator.async_request_refresh()
|
||||
|
||||
@ -163,7 +165,7 @@ class EightSleepBaseEntity(CoordinatorEntity[DataUpdateCoordinator]):
|
||||
self._user_id = user_id
|
||||
self._sensor = sensor
|
||||
self._user_obj: EightUser | None = None
|
||||
if self._user_id:
|
||||
if user_id:
|
||||
self._user_obj = self._eight.users[user_id]
|
||||
|
||||
mapped_name = NAME_MAP.get(sensor, sensor.replace("_", " ").title())
|
||||
|
@ -36,7 +36,7 @@ async def async_setup_platform(
|
||||
entities = []
|
||||
for user in eight.users.values():
|
||||
entities.append(
|
||||
EightHeatSensor(heat_coordinator, eight, user.userid, "bed_presence")
|
||||
EightHeatSensor(heat_coordinator, eight, user.user_id, "bed_presence")
|
||||
)
|
||||
|
||||
async_add_entities(entities)
|
||||
|
@ -2,7 +2,7 @@
|
||||
"domain": "eight_sleep",
|
||||
"name": "Eight Sleep",
|
||||
"documentation": "https://www.home-assistant.io/integrations/eight_sleep",
|
||||
"requirements": ["pyeight==0.2.0"],
|
||||
"requirements": ["pyeight==0.3.0"],
|
||||
"codeowners": ["@mezz64", "@raman325"],
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["pyeight"]
|
||||
|
@ -73,11 +73,11 @@ async def async_setup_platform(
|
||||
for obj in eight.users.values():
|
||||
for sensor in EIGHT_USER_SENSORS:
|
||||
all_sensors.append(
|
||||
EightUserSensor(user_coordinator, eight, obj.userid, sensor)
|
||||
EightUserSensor(user_coordinator, eight, obj.user_id, sensor)
|
||||
)
|
||||
for sensor in EIGHT_HEAT_SENSORS:
|
||||
all_sensors.append(
|
||||
EightHeatSensor(heat_coordinator, eight, obj.userid, sensor)
|
||||
EightHeatSensor(heat_coordinator, eight, obj.user_id, sensor)
|
||||
)
|
||||
for sensor in EIGHT_ROOM_SENSORS:
|
||||
all_sensors.append(EightRoomSensor(user_coordinator, eight, sensor))
|
||||
@ -109,7 +109,7 @@ class EightHeatSensor(EightSleepBaseEntity, SensorEntity):
|
||||
)
|
||||
|
||||
@property
|
||||
def native_value(self) -> int:
|
||||
def native_value(self) -> int | None:
|
||||
"""Return the state of the sensor."""
|
||||
assert self._user_obj
|
||||
return self._user_obj.heating_level
|
||||
@ -270,4 +270,4 @@ class EightRoomSensor(EightSleepBaseEntity, SensorEntity):
|
||||
@property
|
||||
def native_value(self) -> int | float | None:
|
||||
"""Return the state of the sensor."""
|
||||
return self._eight.room_temperature()
|
||||
return self._eight.room_temperature
|
||||
|
@ -1468,7 +1468,7 @@ pyedimax==0.2.1
|
||||
pyefergy==22.1.1
|
||||
|
||||
# homeassistant.components.eight_sleep
|
||||
pyeight==0.2.0
|
||||
pyeight==0.3.0
|
||||
|
||||
# homeassistant.components.emby
|
||||
pyemby==1.8
|
||||
|
Loading…
x
Reference in New Issue
Block a user