diff --git a/homeassistant/components/yamaha_musiccast/const.py b/homeassistant/components/yamaha_musiccast/const.py index 5984d73980f..49234ac38ee 100644 --- a/homeassistant/components/yamaha_musiccast/const.py +++ b/homeassistant/components/yamaha_musiccast/const.py @@ -55,12 +55,3 @@ TRANSLATION_KEY_MAPPING = { "zone_LINK_CONTROL": "zone_link_control", "zone_LINK_AUDIO_DELAY": "zone_link_audio_delay", } - -ZONE_SLEEP_STATE_MAPPING = { - "off": "off", - "30 min": "30_min", - "60 min": "60_min", - "90 min": "90_min", - "120 min": "120_min", -} -STATE_ZONE_SLEEP_MAPPING = {val: key for key, val in ZONE_SLEEP_STATE_MAPPING.items()} diff --git a/homeassistant/components/yamaha_musiccast/manifest.json b/homeassistant/components/yamaha_musiccast/manifest.json index 8c0b55def69..afcc64985dc 100644 --- a/homeassistant/components/yamaha_musiccast/manifest.json +++ b/homeassistant/components/yamaha_musiccast/manifest.json @@ -3,7 +3,7 @@ "name": "MusicCast", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/yamaha_musiccast", - "requirements": ["aiomusiccast==0.14.4"], + "requirements": ["aiomusiccast==0.14.7"], "ssdp": [ { "manufacturer": "Yamaha Corporation" diff --git a/homeassistant/components/yamaha_musiccast/select.py b/homeassistant/components/yamaha_musiccast/select.py index 200d62bde32..a8ca6162c91 100644 --- a/homeassistant/components/yamaha_musiccast/select.py +++ b/homeassistant/components/yamaha_musiccast/select.py @@ -9,11 +9,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import DOMAIN, MusicCastCapabilityEntity, MusicCastDataUpdateCoordinator -from .const import ( - STATE_ZONE_SLEEP_MAPPING, - TRANSLATION_KEY_MAPPING, - ZONE_SLEEP_STATE_MAPPING, -) +from .const import TRANSLATION_KEY_MAPPING async def async_setup_entry( @@ -48,10 +44,6 @@ class SelectableCapapility(MusicCastCapabilityEntity, SelectEntity): async def async_select_option(self, option: str) -> None: """Select the given option.""" value = {val: key for key, val in self.capability.options.items()}[option] - # If the translation key is "zone_sleep", we need to translate - # Home Assistant state back to the MusicCast value - if self.translation_key == "zone_sleep": - value = STATE_ZONE_SLEEP_MAPPING[value] await self.capability.set(value) @property @@ -62,20 +54,9 @@ class SelectableCapapility(MusicCastCapabilityEntity, SelectEntity): @property def options(self) -> list[str]: """Return the list possible options.""" - # If the translation key is "zone_sleep", we need to translate - # the options to make them compatible with Home Assistant - if self.translation_key == "zone_sleep": - return list(STATE_ZONE_SLEEP_MAPPING) return list(self.capability.options.values()) @property def current_option(self) -> str | None: """Return the currently selected option.""" - # If the translation key is "zone_sleep", we need to translate - # the value to make it compatible with Home Assistant - if ( - value := self.capability.current - ) is not None and self.translation_key == "zone_sleep": - return ZONE_SLEEP_STATE_MAPPING[value] - - return value + return self.capability.options.get(self.capability.current) diff --git a/requirements_all.txt b/requirements_all.txt index 6537c5e8464..11ecbffa1ec 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -214,7 +214,7 @@ aiolyric==1.0.9 aiomodernforms==0.1.8 # homeassistant.components.yamaha_musiccast -aiomusiccast==0.14.4 +aiomusiccast==0.14.7 # homeassistant.components.nanoleaf aionanoleaf==0.2.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 92c742ee65d..30c2c02aa50 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -195,7 +195,7 @@ aiolyric==1.0.9 aiomodernforms==0.1.8 # homeassistant.components.yamaha_musiccast -aiomusiccast==0.14.4 +aiomusiccast==0.14.7 # homeassistant.components.nanoleaf aionanoleaf==0.2.1