Tags the name of the device to the end of the name

This helps the media player be more explicit about itself and what it
is. It also namespaces it self a little better in the system. Rather
than be `media_player.family_room` it is
`media_player.family_room_apple_tv`. This helps for cases when there’s
another actual media player like Kodi or Chromecast in there.
This commit is contained in:
Jon Maddox 2015-09-15 21:07:49 -04:00
parent 08f2a67de4
commit 77b9a12687

View file

@ -356,7 +356,10 @@ class AirPlayDevice(MediaPlayerDevice):
self.player_state = state_hash.get('player_state', None)
if 'name' in state_hash:
self.device_name = state_hash.get('name', 'AirPlay')
name = state_hash.get('name', '')
kind = state_hash.get('kind', 'AirPlay')
self.device_name = (name + ' ' + kind).strip()
if 'kind' in state_hash:
self.kind = state_hash.get('kind', None)