26 lines
687 B
Python
26 lines
687 B
Python
import asyncio
|
|
import time
|
|
from esasdk import Machine
|
|
|
|
async def main():
|
|
# Connect to a machine
|
|
machine = Machine("ws://localhost:5424")
|
|
await machine.connect()
|
|
|
|
# Get machine power
|
|
power = await machine.power()
|
|
print(f"Machine Power (Volts): {power}")
|
|
|
|
# Get machine power source
|
|
powerSource = await machine.power_source()
|
|
print(f"Machine Power Source: {powerSource}")
|
|
|
|
# Set machine power timer - TODO: cpp response for this call.
|
|
powerTimer = await machine.poweroff_timer_enable(False)
|
|
print(f"Machine Power Timer: {powerTimer}")
|
|
|
|
# Close connection
|
|
await machine.close()
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main()) |