mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Add volume_up and volume_down to musiccast (#57919)
This commit is contained in:
parent
4f0886fd7d
commit
c6aa767be6
@ -4,7 +4,7 @@
|
|||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/yamaha_musiccast",
|
"documentation": "https://www.home-assistant.io/integrations/yamaha_musiccast",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"aiomusiccast==0.10.0"
|
"aiomusiccast==0.11.0"
|
||||||
],
|
],
|
||||||
"ssdp": [
|
"ssdp": [
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,7 @@ from homeassistant.components.media_player.const import (
|
|||||||
SUPPORT_TURN_ON,
|
SUPPORT_TURN_ON,
|
||||||
SUPPORT_VOLUME_MUTE,
|
SUPPORT_VOLUME_MUTE,
|
||||||
SUPPORT_VOLUME_SET,
|
SUPPORT_VOLUME_SET,
|
||||||
|
SUPPORT_VOLUME_STEP,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -288,6 +289,14 @@ class MusicCastMediaPlayer(MusicCastDeviceEntity, MediaPlayerEntity):
|
|||||||
await self.coordinator.musiccast.set_volume_level(self._zone_id, volume)
|
await self.coordinator.musiccast.set_volume_level(self._zone_id, volume)
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
|
async def async_volume_up(self):
|
||||||
|
"""Turn volume up for media player."""
|
||||||
|
await self.coordinator.musiccast.volume_up(self._zone_id)
|
||||||
|
|
||||||
|
async def async_volume_down(self):
|
||||||
|
"""Turn volume down for media player."""
|
||||||
|
await self.coordinator.musiccast.volume_down(self._zone_id)
|
||||||
|
|
||||||
async def async_media_play(self):
|
async def async_media_play(self):
|
||||||
"""Send play command."""
|
"""Send play command."""
|
||||||
if self._is_netusb:
|
if self._is_netusb:
|
||||||
@ -460,7 +469,7 @@ class MusicCastMediaPlayer(MusicCastDeviceEntity, MediaPlayerEntity):
|
|||||||
if ZoneFeature.POWER in zone.features:
|
if ZoneFeature.POWER in zone.features:
|
||||||
supported_features |= SUPPORT_TURN_ON | SUPPORT_TURN_OFF
|
supported_features |= SUPPORT_TURN_ON | SUPPORT_TURN_OFF
|
||||||
if ZoneFeature.VOLUME in zone.features:
|
if ZoneFeature.VOLUME in zone.features:
|
||||||
supported_features |= SUPPORT_VOLUME_SET
|
supported_features |= SUPPORT_VOLUME_SET | SUPPORT_VOLUME_STEP
|
||||||
if ZoneFeature.MUTE in zone.features:
|
if ZoneFeature.MUTE in zone.features:
|
||||||
supported_features |= SUPPORT_VOLUME_MUTE
|
supported_features |= SUPPORT_VOLUME_MUTE
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ aiolyric==1.0.7
|
|||||||
aiomodernforms==0.1.8
|
aiomodernforms==0.1.8
|
||||||
|
|
||||||
# homeassistant.components.yamaha_musiccast
|
# homeassistant.components.yamaha_musiccast
|
||||||
aiomusiccast==0.10.0
|
aiomusiccast==0.11.0
|
||||||
|
|
||||||
# homeassistant.components.nanoleaf
|
# homeassistant.components.nanoleaf
|
||||||
aionanoleaf==0.0.3
|
aionanoleaf==0.0.3
|
||||||
|
@ -143,7 +143,7 @@ aiolyric==1.0.7
|
|||||||
aiomodernforms==0.1.8
|
aiomodernforms==0.1.8
|
||||||
|
|
||||||
# homeassistant.components.yamaha_musiccast
|
# homeassistant.components.yamaha_musiccast
|
||||||
aiomusiccast==0.10.0
|
aiomusiccast==0.11.0
|
||||||
|
|
||||||
# homeassistant.components.nanoleaf
|
# homeassistant.components.nanoleaf
|
||||||
aionanoleaf==0.0.3
|
aionanoleaf==0.0.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user