Bump asyncsleepiq to 1.2.1 (#68680)

This commit is contained in:
Mike Fugate 2022-03-25 16:47:28 -04:00 committed by GitHub
parent faf1f229e1
commit 4dc8aff3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 29 deletions

View File

@ -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": [
{

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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")