mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Bump asyncsleepiq to 1.2.1 (#68680)
This commit is contained in:
parent
faf1f229e1
commit
4dc8aff3d5
@ -3,7 +3,7 @@
|
||||
"name": "SleepIQ",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/sleepiq",
|
||||
"requirements": ["asyncsleepiq==1.2.0"],
|
||||
"requirements": ["asyncsleepiq==1.2.1"],
|
||||
"codeowners": ["@mfugate1", "@kbickar"],
|
||||
"dhcp": [
|
||||
{
|
||||
|
@ -1,16 +1,7 @@
|
||||
"""Support for SleepIQ foundation preset selection."""
|
||||
from __future__ import annotations
|
||||
|
||||
from asyncsleepiq import (
|
||||
FAVORITE,
|
||||
FLAT,
|
||||
READ,
|
||||
SNORE,
|
||||
WATCH_TV,
|
||||
ZERO_G,
|
||||
SleepIQBed,
|
||||
SleepIQPreset,
|
||||
)
|
||||
from asyncsleepiq import BED_PRESETS, SleepIQBed, SleepIQPreset
|
||||
|
||||
from homeassistant.components.select import SelectEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
@ -22,16 +13,6 @@ from .const import DOMAIN
|
||||
from .coordinator import SleepIQData
|
||||
from .entity import SleepIQBedEntity
|
||||
|
||||
FOUNDATION_PRESET_NAMES = {
|
||||
"Not at preset": 0,
|
||||
"Favorite": FAVORITE,
|
||||
"Read": READ,
|
||||
"Watch TV": WATCH_TV,
|
||||
"Flat": FLAT,
|
||||
"Zero G": ZERO_G,
|
||||
"Snore": SNORE,
|
||||
}
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
@ -50,7 +31,7 @@ async def async_setup_entry(
|
||||
class SleepIQSelectEntity(SleepIQBedEntity, SelectEntity):
|
||||
"""Representation of a SleepIQ select entity."""
|
||||
|
||||
_attr_options = list(FOUNDATION_PRESET_NAMES.keys())
|
||||
_attr_options = list(BED_PRESETS)
|
||||
|
||||
def __init__(
|
||||
self, coordinator: DataUpdateCoordinator, bed: SleepIQBed, preset: SleepIQPreset
|
||||
@ -77,6 +58,6 @@ class SleepIQSelectEntity(SleepIQBedEntity, SelectEntity):
|
||||
|
||||
async def async_select_option(self, option: str) -> None:
|
||||
"""Change the current preset."""
|
||||
await self.preset.set_preset(FOUNDATION_PRESET_NAMES[option])
|
||||
await self.preset.set_preset(option)
|
||||
self._attr_current_option = option
|
||||
self.async_write_ha_state()
|
||||
|
@ -335,7 +335,7 @@ async-upnp-client==0.27.0
|
||||
asyncpysupla==0.0.5
|
||||
|
||||
# homeassistant.components.sleepiq
|
||||
asyncsleepiq==1.2.0
|
||||
asyncsleepiq==1.2.1
|
||||
|
||||
# homeassistant.components.aten_pe
|
||||
atenpdu==0.3.2
|
||||
|
@ -265,7 +265,7 @@ arcam-fmj==0.12.0
|
||||
async-upnp-client==0.27.0
|
||||
|
||||
# homeassistant.components.sleepiq
|
||||
asyncsleepiq==1.2.0
|
||||
asyncsleepiq==1.2.1
|
||||
|
||||
# homeassistant.components.aurora
|
||||
auroranoaa==0.0.2
|
||||
|
@ -1,8 +1,6 @@
|
||||
"""Tests for the SleepIQ select platform."""
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from asyncsleepiq import ZERO_G
|
||||
|
||||
from homeassistant.components.select import DOMAIN, SERVICE_SELECT_OPTION
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
@ -75,7 +73,7 @@ async def test_split_foundation_preset(
|
||||
|
||||
mock_asyncsleepiq.beds[BED_ID].foundation.presets[0].set_preset.assert_called_once()
|
||||
mock_asyncsleepiq.beds[BED_ID].foundation.presets[0].set_preset.assert_called_with(
|
||||
ZERO_G
|
||||
"Zero G"
|
||||
)
|
||||
|
||||
|
||||
@ -116,4 +114,4 @@ async def test_single_foundation_preset(
|
||||
].set_preset.assert_called_once()
|
||||
mock_asyncsleepiq_single_foundation.beds[BED_ID].foundation.presets[
|
||||
0
|
||||
].set_preset.assert_called_with(ZERO_G)
|
||||
].set_preset.assert_called_with("Zero G")
|
||||
|
Loading…
x
Reference in New Issue
Block a user