Fix sleepiq with python 3.11 (#88098)

There is a breaking change in enum behavior

see https://blog.pecar.me/python-enum
pull/88106/head
J. Nick Koston 2023-02-14 10:26:33 -06:00 committed by GitHub
parent 3e8a6cb3b7
commit 9593d9610d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ def _get_actuator_name(bed: SleepIQBed, actuator: SleepIQActuator) -> str:
def _get_actuator_unique_id(bed: SleepIQBed, actuator: SleepIQActuator) -> str:
if actuator.side:
return f"{bed.id}_{actuator.side}_{actuator.actuator}"
return f"{bed.id}_{actuator.side.value}_{actuator.actuator}"
return f"{bed.id}_{actuator.actuator}"

View File

@ -45,7 +45,7 @@ class SleepIQSelectEntity(SleepIQBedEntity[SleepIQDataUpdateCoordinator], Select
self._attr_unique_id = f"{bed.id}_preset"
if preset.side != Side.NONE:
self._attr_name += f" {preset.side_full}"
self._attr_unique_id += f"_{preset.side}"
self._attr_unique_id += f"_{preset.side.value}"
super().__init__(coordinator, bed)
self._async_update_attrs()