Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions homeassistant/components/ws66i/media_player.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
"""Support for interfacing with WS66i 6 zone home audio controller."""
from copy import deepcopy
import logging

from pyws66i import WS66i, ZoneStatus

from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
SUPPORT_VOLUME_MUTE,
SUPPORT_VOLUME_SET,
SUPPORT_VOLUME_STEP,
from homeassistant.components.media_player import (
MediaPlayerEntity,
MediaPlayerEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_OFF, STATE_ON
Expand All @@ -28,19 +22,8 @@
from .coordinator import Ws66iDataUpdateCoordinator
from .models import Ws66iData

_LOGGER = logging.getLogger(__name__)

PARALLEL_UPDATES = 1

SUPPORT_WS66I = (
SUPPORT_VOLUME_MUTE
| SUPPORT_VOLUME_SET
| SUPPORT_VOLUME_STEP
| SUPPORT_TURN_ON
| SUPPORT_TURN_OFF
| SUPPORT_SELECT_SOURCE
)

MAX_VOL = 38


Expand Down Expand Up @@ -105,7 +88,14 @@ def __init__(
self._attr_source_list = ws66i_data.sources.name_list
self._attr_unique_id = f"{entry_id}_{self._zone_id}"
self._attr_name = f"Zone {self._zone_id}"
self._attr_supported_features = SUPPORT_WS66I
self._attr_supported_features = (
MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.SELECT_SOURCE
)
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, str(self.unique_id))},
name=self.name,
Expand Down