-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add foot warmer support for Climate360 beds
Add foot warmer support for Climate360 beds
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Foundation foor warmer for Fuzion SleepIQ API.""" | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
from ..consts import SIDES_FULL, FootWarmingTemps | ||
from ..foot_warmer import SleepIQFootWarmer | ||
|
||
|
||
class SleepIQFuzionFootWarmer(SleepIQFootWarmer): | ||
"""Foot warmer representation for SleepIQ API.""" | ||
|
||
async def set_foot_warming(self, temperature: FootWarmingTemps, time: int) -> None: | ||
"""Set foot warmer state through API.""" | ||
if time <= 0 or time > 360: | ||
raise ValueError("Invalid Time, must be between 0 and 360") | ||
|
||
args = [SIDES_FULL[self.side].lower(), temperature.name.lower(), str(time)] | ||
await self._api.bamkey(self.bed_id, "SetFootwarmingSettings", args) | ||
await self.update({}) | ||
|
||
async def update(self, data: dict[str, Any]) -> None: | ||
"""Update the foot warmer through the API.""" | ||
args = [SIDES_FULL[self.side].lower()] | ||
self.preset = await self._api.bamkey(self.bed_id, "GetFootwarmingSettings", args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters