Update self.chromecasts on each get_chromecasts() call
This commit is contained in:
parent
3c0ed443a2
commit
ba48e52fb1
1 changed files with 6 additions and 1 deletions
|
@ -47,6 +47,11 @@ class MediaChromecastPlugin(MediaPlugin):
|
||||||
Get the list of Chromecast devices
|
Get the list of Chromecast devices
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
self.chromecasts.update({
|
||||||
|
cast.device.friendly_name: cast
|
||||||
|
for cast in pychromecast.get_chromecasts()
|
||||||
|
})
|
||||||
|
|
||||||
return [ {
|
return [ {
|
||||||
'type': cc.cast_type,
|
'type': cc.cast_type,
|
||||||
'name': cc.name,
|
'name': cc.name,
|
||||||
|
@ -69,7 +74,7 @@ class MediaChromecastPlugin(MediaPlugin):
|
||||||
'volume': round(100*cc.status.volume_level, 2),
|
'volume': round(100*cc.status.volume_level, 2),
|
||||||
'muted': cc.status.volume_muted,
|
'muted': cc.status.volume_muted,
|
||||||
} if cc.status else {}),
|
} if cc.status else {}),
|
||||||
} for cc in pychromecast.get_chromecasts() ]
|
} for cc in self.chromecasts.values() ]
|
||||||
|
|
||||||
|
|
||||||
def get_chromecast(self, chromecast=None, n_tries=3):
|
def get_chromecast(self, chromecast=None, n_tries=3):
|
||||||
|
|
Loading…
Reference in a new issue