So i tried to get the status of my chromecast with pychromecast.
I have a ubuntu server 16 with the latest version of pychomecast.
When i run this scripts (is under pychromecast folder) :
Code: Select all
from __future__ import print_function
import time
import sys
import logging
import json
import codecs
import urllib
import pychromecast
cast = pychromecast.Chromecast("192.168.xx.xx")
print(cast.device)
print(cast.status)
print(cast.media_controller.status)
Code: Select all
DeviceStatus(friendly_name=u'Salon', model_name=u'Eureka Dongle', manufacturer=u'Google Inc.', api_version=(1, 0), uuid=UUID('xx'), cast_type='cast')
None
<MediaStatus {'player_state': 'UNKNOWN', 'volume_level': 1, 'images': [], 'media_custom_data': {}, 'duration': None, 'current_time': 0, 'playback_rate': 1, 'title': None, 'media_session_id': None, 'volume_muted': False, 'supports_skip_forward': False, 'track': None, 'season': None, 'idle_reason': None, 'stream_type': 'UNKNOWN', 'supports_stream_mute': False, 'supports_stream_volume': False, 'content_type': None, 'metadata_type': None, 'subtitle_tracks': {}, 'album_name': None, 'series_title': None, 'album_artist': None, 'media_metadata': {}, 'episode': None, 'artist': None, 'supported_media_commands': 0, 'supports_seek': False, 'current_subtitle_tracks': [], 'content_id': None, 'supports_skip_backward': False, 'supports_pause': False}>
But i be have "player_state : Idle" and not UNKNOW.
I don't understand my probleme because the value of cast.status is good !
Thanks !