diff --git a/homeassistant/components/openhome/manifest.json b/homeassistant/components/openhome/manifest.json index 2ec58b86125..7640c388747 100644 --- a/homeassistant/components/openhome/manifest.json +++ b/homeassistant/components/openhome/manifest.json @@ -2,9 +2,7 @@ "domain": "openhome", "name": "Openhome", "documentation": "https://www.home-assistant.io/integrations/openhome", - "requirements": [ - "openhomedevice==0.4.2" - ], + "requirements": ["openhomedevice==0.6.3"], "dependencies": [], "codeowners": [] } diff --git a/homeassistant/components/openhome/media_player.py b/homeassistant/components/openhome/media_player.py index 0443187ac63..fbcd5f3ba02 100644 --- a/homeassistant/components/openhome/media_player.py +++ b/homeassistant/components/openhome/media_player.py @@ -17,14 +17,7 @@ from homeassistant.components.media_player.const import ( ) from homeassistant.const import STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING -SUPPORT_OPENHOME = ( - SUPPORT_SELECT_SOURCE - | SUPPORT_VOLUME_STEP - | SUPPORT_VOLUME_MUTE - | SUPPORT_VOLUME_SET - | SUPPORT_TURN_OFF - | SUPPORT_TURN_ON -) +SUPPORT_OPENHOME = SUPPORT_SELECT_SOURCE | SUPPORT_TURN_OFF | SUPPORT_TURN_ON _LOGGER = logging.getLogger(__name__) @@ -79,14 +72,19 @@ class OpenhomeDevice(MediaPlayerDevice): self._in_standby = self._device.IsInStandby() self._transport_state = self._device.TransportState() self._track_information = self._device.TrackInfo() - self._volume_level = self._device.VolumeLevel() - self._volume_muted = self._device.IsMuted() self._source = self._device.Source() self._name = self._device.Room().decode("utf-8") self._supported_features = SUPPORT_OPENHOME source_index = {} source_names = list() + if self._device.VolumeEnabled(): + self._supported_features |= ( + SUPPORT_VOLUME_STEP | SUPPORT_VOLUME_MUTE | SUPPORT_VOLUME_SET + ) + self._volume_level = self._device.VolumeLevel() + self._volume_muted = self._device.IsMuted() + for source in self._device.Sources(): source_names.append(source["name"]) source_index[source["name"]] = source["index"] diff --git a/requirements_all.txt b/requirements_all.txt index 75d0115fa48..4b3d88d9241 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -921,7 +921,7 @@ onvif-zeep-async==0.2.0 openevsewifi==0.4 # homeassistant.components.openhome -openhomedevice==0.4.2 +openhomedevice==0.6.3 # homeassistant.components.opensensemap opensensemap-api==0.1.5