Calculate power factor #10

Merged
sqozz merged 4 commits from cfr34k/sem6000:power_factor into master 2020-01-20 21:09:36 +01:00
Showing only changes of commit 7b82461f03 - Show all commits

View file

@ -29,7 +29,7 @@ while True:
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 (PF: {})".format(socket.voltage, socket.current, socket.power, socket.frequency, socket.power_factor)) 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, BrokenPipeError):
print("Restarting...") print("Restarting...")
if socket != None: if socket != None:
socket.disconnect() socket.disconnect()