Skip to content

Commit

Permalink
Update python example
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Apr 11, 2024
1 parent cf25c9a commit f343759
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/monitor_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,15 @@
# you can ask to be notified.
# this represents the complete current state of the driver
#
# DriverClient.receive(Callable[list[Monitor], None])
# DriverClient.receive(Optional[Callable[list[Monitor], None]])
client.receive(lambda d: print(d))
# one way to use this might be to auto update your driver instance
def set_monitors(data):
client.monitors = data
# calling it on a new callback will cancel the old one and set the new one
client.receive(set_monitors)
# calling it with no args will cancel the current receiver
client.receive()

# gets latest states from driver
#
Expand Down

0 comments on commit f343759

Please sign in to comment.