MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _systemctl_state_label

Function _systemctl_state_label

webapp_modern.py:2006–2019  ·  view source on GitHub ↗
(service_name: str)

Source from the content-addressed store, hash-verified

2004 pending = _rusense_notify_state.get('pending_close_ts')
2005 if pending is not None and (now - pending) > _RUSENSE_SIGHTING_MERGE_S:
2006 if alerts_now:
2007 po.notify_rusense(
2008 'presence',
2009 "\U0001F6E1️ A monitored space is now empty.",
2010 title="RuSense — Empty")
2011 _rusense_close_sighting(pending) # ends at the moment it actually fell
2012 _rusense_notify_state['pending_close_ts'] = None
2013 # Vitals lag first detection, so keep filling in the open sighting while
2014 # the space stays occupied (no-op when there is no open sighting).
2015 if present:
2016 _rusense_update_sighting(now, conf if confident else None, vitals)
2017 # Publish the smoothed, model-aware presence decision (the SAME state that
2018 # gates alerts) for the dashboard to render — one source of truth instead
2019 # of the frontend re-deriving presence from a noisier 2s window.
2020 bk_present = _rusense_notify_state.get('presence_state', False)
2021 _rusense_notify_state['presence_pub'] = {
2022 'present': bool(bk_present),

Callers 2

_build_pwnagotchi_statusFunction · 0.85
kiosk_statusFunction · 0.85

Calls 3

warningMethod · 0.80
debugMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected