summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-01-26 02:56:57 -0600
committerRaptor Engineering Development Team <support@raptorengineering.com>2019-04-19 10:28:12 +0000
commit5b0b18c9894d2ed73fedf15c83b5df670fe790fe (patch)
tree9d341592159973fce460ffce609875dc1daa1127
parentef0c83d753d0581f07d454be8c4161dbe6e36d21 (diff)
downloadblackbird-skeleton-5b0b18c9894d2ed73fedf15c83b5df670fe790fe.tar.gz
blackbird-skeleton-5b0b18c9894d2ed73fedf15c83b5df670fe790fe.zip
Only sound beep once per IPL completion
-rw-r--r--pyiplledmonitor/ipl_status_led_monitor.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pyiplledmonitor/ipl_status_led_monitor.py b/pyiplledmonitor/ipl_status_led_monitor.py
index 29f1ae6..ac3d6ad 100644
--- a/pyiplledmonitor/ipl_status_led_monitor.py
+++ b/pyiplledmonitor/ipl_status_led_monitor.py
@@ -54,7 +54,7 @@ class IPLStatusLEDMonitor(DbusProperties, DbusObjectManager):
for x in [114, 111, 116, 49, 51]])
random.seed(None)
- self.updateIPLLeds(True)
+ self.updateIPLLeds(True, True)
bus.add_signal_receiver(
self.IPLStatusChangeHandler,
@@ -129,8 +129,11 @@ class IPLStatusLEDMonitor(DbusProperties, DbusObjectManager):
def IPLStatusChangeHandler(self, interface_name, changed_properties,
invalidated_properties):
+ status_changed = False
value = changed_properties.get('current_status')
if value is not None:
+ if (self.current_ipl_status != value):
+ status_changed = True
self.current_ipl_status = value
value = changed_properties.get('current_istep')
if value is not None:
@@ -142,9 +145,9 @@ class IPLStatusLEDMonitor(DbusProperties, DbusObjectManager):
self.current_ipl_istep_major = 0
self.current_ipl_istep_minor = 0
- self.updateIPLLeds(False)
+ self.updateIPLLeds(False, status_changed)
- def updateIPLLeds(self, initial_start):
+ def updateIPLLeds(self, initial_start, status_changed):
if (self.current_ipl_status == "IPL_RUNNING"):
# Show major ISTEP on LED bank
# On Talos we only have three LEDs plus a fourth indicator modification bit, but the major ISTEPs range from 2 to 21
@@ -183,7 +186,7 @@ class IPLStatusLEDMonitor(DbusProperties, DbusObjectManager):
proc = subprocess.Popen(["i2cset", "-y", "12", "0x31", "0x10", "0x00"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'wb'), shell=False)
(out, err) = proc.communicate()
- if (self.current_ipl_status == "IPL_COMPLETE"):
+ if ((status_changed == True) and (self.current_ipl_status == "IPL_COMPLETE")):
if (initial_start == False):
# Sound IPL complete beep
try:
OpenPOWER on IntegriCloud