From f5bbfec17ff8c2d478321e63c468367e89cc2e70 Mon Sep 17 00:00:00 2001 From: gunu3371 <55932910+gunu3371@users.noreply.github.com> Date: Sun, 14 Jul 2024 01:39:53 +0900 Subject: [PATCH] Update service.py --- service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service.py b/service.py index 655e348..0b2026a 100755 --- a/service.py +++ b/service.py @@ -90,7 +90,7 @@ class Alarm: self.piezo.frequency = 523 def on(self): - self.piezo.duty_cycle = 45000 + self.piezo.duty_cycle = 50000 def off(self): self.piezo.duty_cycle = 0 @@ -115,6 +115,7 @@ while not killer.kill_now: elif ps == "chg": log.info('AC power restored Charging') elif ps == "dch": + buz.on() log.warn('AC power loss') pw = int(ups.get_curvol()) if pw <= 3500: @@ -130,5 +131,7 @@ while not killer.kill_now: log.info("Current Voltage "+ups.get_curvol()+"mV") time.sleep(0.5) - + buz.off() + time.sleep(0.5) +buz.off() log.info('UPS service stopped successfully')