mirror of
https://github.com/gunu3371/m1s_ups_control.git
synced 2024-09-25 05:35:40 +00:00
Update service.py
This commit is contained in:
parent
f168bae171
commit
f5bbfec17f
@ -90,7 +90,7 @@ class Alarm:
|
|||||||
self.piezo.frequency = 523
|
self.piezo.frequency = 523
|
||||||
|
|
||||||
def on(self):
|
def on(self):
|
||||||
self.piezo.duty_cycle = 45000
|
self.piezo.duty_cycle = 50000
|
||||||
|
|
||||||
def off(self):
|
def off(self):
|
||||||
self.piezo.duty_cycle = 0
|
self.piezo.duty_cycle = 0
|
||||||
@ -115,6 +115,7 @@ while not killer.kill_now:
|
|||||||
elif ps == "chg":
|
elif ps == "chg":
|
||||||
log.info('AC power restored Charging')
|
log.info('AC power restored Charging')
|
||||||
elif ps == "dch":
|
elif ps == "dch":
|
||||||
|
buz.on()
|
||||||
log.warn('AC power loss')
|
log.warn('AC power loss')
|
||||||
pw = int(ups.get_curvol())
|
pw = int(ups.get_curvol())
|
||||||
if pw <= 3500:
|
if pw <= 3500:
|
||||||
@ -130,5 +131,7 @@ while not killer.kill_now:
|
|||||||
|
|
||||||
log.info("Current Voltage "+ups.get_curvol()+"mV")
|
log.info("Current Voltage "+ups.get_curvol()+"mV")
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
buz.off()
|
||||||
|
time.sleep(0.5)
|
||||||
|
buz.off()
|
||||||
log.info('UPS service stopped successfully')
|
log.info('UPS service stopped successfully')
|
||||||
|
Loading…
Reference in New Issue
Block a user