events: evaluate FLIPOFF_DRYRUN at trigger time, not import time
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7ba13a47cba9f396bc91c994e0b5a0756a6a6964
This commit is contained in:
parent
5e1b4321fd
commit
5d0c2782cb
1 changed files with 1 additions and 2 deletions
|
|
@ -15,10 +15,9 @@ class Event(ABC):
|
|||
|
||||
class PoweroffEvent(Event):
|
||||
name = "poweroff"
|
||||
DEBUG: bool = os.environ.get("FLIPOFF_DRYRUN", "0") == "1"
|
||||
|
||||
async def trigger(self) -> None:
|
||||
if self.DEBUG:
|
||||
if os.environ.get("FLIPOFF_DRYRUN", "0") == "1":
|
||||
print("DRYRUN: Would power off")
|
||||
return
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue