Skip to content

Commit

Permalink
Fix SleepIQ setting FootWarmer timer (home-assistant#108433)
Browse files Browse the repository at this point in the history
* Fixing foot warmer timer bug

* Fixing bug where temperature wasnt assigned to number entity causing tests to fail
  • Loading branch information
jmwaldrip authored and catsmanac committed Jan 23, 2024
1 parent 1dece1e commit 3fc13ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion homeassistant/components/sleepiq/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
from dataclasses import dataclass
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.config_entries import ConfigEntry
Expand Down Expand Up @@ -79,6 +85,10 @@ def _get_sleeper_unique_id(bed: SleepIQBed, sleeper: SleepIQSleeper) -> str:
async def _async_set_foot_warmer_time(
foot_warmer: SleepIQFootWarmer, time: int
) -> None:
temperature = FootWarmingTemps(foot_warmer.temperature)
if temperature != FootWarmingTemps.OFF:
await foot_warmer.turn_on(temperature, time)

foot_warmer.timer = time


Expand Down

0 comments on commit 3fc13ad

Please sign in to comment.