mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Fix SleepIQ setting FootWarmer timer (#108433)
* Fixing foot warmer timer bug * Fixing bug where temperature wasnt assigned to number entity causing tests to fail
This commit is contained in:
parent
21009bef02
commit
d75dd0973f
@ -5,7 +5,13 @@ from collections.abc import Callable, Coroutine
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from asyncsleepiq import SleepIQActuator, SleepIQBed, SleepIQFootWarmer, SleepIQSleeper
|
from asyncsleepiq import (
|
||||||
|
FootWarmingTemps,
|
||||||
|
SleepIQActuator,
|
||||||
|
SleepIQBed,
|
||||||
|
SleepIQFootWarmer,
|
||||||
|
SleepIQSleeper,
|
||||||
|
)
|
||||||
|
|
||||||
from homeassistant.components.number import NumberEntity, NumberEntityDescription
|
from homeassistant.components.number import NumberEntity, NumberEntityDescription
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -79,6 +85,10 @@ def _get_sleeper_unique_id(bed: SleepIQBed, sleeper: SleepIQSleeper) -> str:
|
|||||||
async def _async_set_foot_warmer_time(
|
async def _async_set_foot_warmer_time(
|
||||||
foot_warmer: SleepIQFootWarmer, time: int
|
foot_warmer: SleepIQFootWarmer, time: int
|
||||||
) -> None:
|
) -> None:
|
||||||
|
temperature = FootWarmingTemps(foot_warmer.temperature)
|
||||||
|
if temperature != FootWarmingTemps.OFF:
|
||||||
|
await foot_warmer.turn_on(temperature, time)
|
||||||
|
|
||||||
foot_warmer.timer = time
|
foot_warmer.timer = time
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user