Calculate power factor #10
|
@ -28,7 +28,7 @@ while True:
|
||||||
socket.getStatus()
|
socket.getStatus()
|
||||||
socket.setStatus(True)
|
socket.setStatus(True)
|
||||||
print("=== {} ({}) ===".format(socket.mac_address, "on" if socket.powered else "off"))
|
print("=== {} ({}) ===".format(socket.mac_address, "on" if socket.powered else "off"))
|
||||||
print("\t{}V {}A → {}W@{}Hz".format(socket.voltage, socket.current, socket.power, socket.frequency))
|
print("\t{}V {}A → {}W@{}Hz (PF: {})".format(socket.voltage, socket.current, socket.power, socket.frequency, socket.power_factor))
|
||||||
except (SEMSocket.NotConnectedException, bluepy.btle.BTLEDisconnectError):
|
except (SEMSocket.NotConnectedException, bluepy.btle.BTLEDisconnectError):
|
||||||
print("Restarting...")
|
print("Restarting...")
|
||||||
if socket != None:
|
if socket != None:
|
||||||
|
|
Loading…
Reference in a new issue