Closed acateon closed 6 years ago
The turn off button shouldn't be there at all, as the DLNA DMR spec doesn't support this call.
Did other controls work, though, like previous/next/pause/volume/...?
Nope... Volume shows up but does not work, no play/pause etc show, neither any playing info.
Included a zip with all the xml's while playing audio.
Sorry for the late reply. Thank you for sending the XMLs. This is a first step of troubleshooting.
I need a bit more information though. The XMLs seem to be ok/the device should work. However, it is strange that you're seeing supported_features: 12
.
Can you change alter the DlnaDmrDevice.supported_features() method by replacing it with this:
@property
def supported_features(self):
"""Flag media player features that are supported."""
supported_features = 0
if not self._device:
return supported_features
rc_service = self._service('RC')
if rc_service:
if rc_service.state_variable('Mute'):
supported_features |= SUPPORT_VOLUME_MUTE
if rc_service.state_variable('Volume'):
supported_features |= SUPPORT_VOLUME_SET
avt_service = self._service('AVT')
if avt_service:
state_var = avt_service.state_variable('CurrentTransportActions')
_LOGGER.debug('%s.supported_features(): %s: %s', self, state_var, state_var.value if state_var else "xxx")
if state_var:
value = state_var.value or ''
actions = value.split(',')
if 'Play' in actions:
supported_features |= SUPPORT_PLAY
if 'Stop' in actions:
supported_features |= SUPPORT_STOP
if 'Pause' in actions:
supported_features |= SUPPORT_PAUSE
current_track_var = avt_service.state_variable('CurrentTrack')
num_tracks_var = avt_service.state_variable('NumberOfTracks')
if current_track_var and num_tracks_var and \
current_track_var.value is not None and num_tracks_var.value is not None:
current_track = current_track_var.value
num_tracks = num_tracks_var.value
if current_track > 1:
supported_features |= SUPPORT_PREVIOUS_TRACK
if num_tracks > current_track:
supported_features |= SUPPORT_NEXT_TRACK
return supported_features
Actually, the line which starts with _LOGGER.debug()
is the only one you need to add.
Then, in your ~/.homeassistant/configuration.yaml
add this:
logger:
default: info
logs:
custom_components.media_player.dlna_dmr: debug
custom_components.media_player.upnp_client: debug
This should give debugging information, which in turn might help finding the problem.
Also, can you try playing something with a UPnP client, such as the app BubbleUPnP
.
Again, sorry for the late reply.
This component is now integrated into home assistant itself. You should use that instead. Netdisco/discovery will discover the device for you without any manual configuration.
Still, you still have to enable discovery of it explicitly. You can do this by opting-in discovery of dlna_dmr devices, like so in your config:
discovery:
enable:
- dlna_dmr
First of all, great initiative!
My TV gets registered with the new media player platform and shows the following.
`
`
But when I fire a service call to turn it off it throws the following errors: