Skip to content

Commit

Permalink
Update README.rst (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Nov 21, 2023
1 parent 358604f commit 819d37b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ How to use
>> import time
>> import pychromecast
>> import zeroconf
>> # List chromecasts on the network, but don't connect
>> services, browser = pychromecast.discovery.discover_chromecasts()
>> # Create a browser which prints the friendly name of found chromecast devices
>> zconf = zeroconf.Zeroconf()
>> browser = pychromecast.CastBrowser(pychromecast.SimpleCastListener(lambda uuid, service: print(browser.devices[uuid].friendly_name)), zconf)
>> browser.start_discovery()
>> # Shut down discovery
>> pychromecast.discovery.stop_discovery(browser)
Expand All @@ -48,7 +51,7 @@ How to use
>> # Start worker thread and wait for cast device to be ready
>> cast.wait()
>> print(cast.cast_info)
DeviceStatus(friendly_name='Living Room', model_name='Chromecast', manufacturer='Google Inc.', uuid=UUID('df6944da-f016-4cb8-97d0-3da2ccaa380b'), cast_type='cast')
CastInfo(services={ServiceInfo(type='mdns', data='Chromecast-Audio-42feced1d94238232fba92623e2682f3._googlecast._tcp.local.')}, uuid=UUID('42feced1-d942-3823-2fba-92623e2682f3'), model_name='Chromecast Audio', friendly_name='Living room', host='192.168.0.189', port=8009, cast_type='audio', manufacturer='Google Inc.')
>> print(cast.status)
CastStatus(is_active_input=True, is_stand_by=False, volume_level=1.0, volume_muted=False, app_id='CC1AD845', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.player.message', 'urn:x-cast:com.google.cast.media'], session_id='CCA39713-9A4F-34A6-A8BF-5D97BE7ECA5C', transport_id='web-9', status_text='')
Expand Down

0 comments on commit 819d37b

Please sign in to comment.