X-Git-Url: https://git.realraum.at/?p=svn42.git;a=blobdiff_plain;f=switch-power.py;fp=switch-power.py;h=15027d6a59e15f62aac2ce83dfb1ef771242fdf4;hp=9f7ac69c699cdecda8db8986f53b65b425af3cd5;hb=e73500fe1313f6c4ec02e19fe906466d6b875821;hpb=bef28638e5cf8df1081d26ac5f0c6211f78b3ce3 diff --git a/switch-power.py b/switch-power.py index 9f7ac69..15027d6 100755 --- a/switch-power.py +++ b/switch-power.py @@ -210,12 +210,6 @@ def eventPeriodical(): def eventPresent(): global status_presence,room_is_bright,unixts_last_movement,uwscfg,unixts_last_presence unixts_last_presence=time.time() - if ( time.time() - unixts_last_movement ) <= float(uwscfg.powerswitching_secs_movement_before_presence_to_launch_event): - eventPresentAndMoved() - - -def eventPresentAndMoved(): - global status_presence,room_is_bright logging.debug("eventPresent()"); status_presence=True if haveDaylight(): @@ -229,6 +223,12 @@ def eventPresentAndMoved(): for id in present_ids.split(" "): switchPower(id,True) switchLogo(status_presence) + if ( time.time() - unixts_last_movement ) <= float(uwscfg.powerswitching_secs_movement_before_presence_to_launch_event): + eventPresentAndMoved() + +def eventPresentAndMoved(): + global status_presence,room_is_bright + pass def eventNobodyHere(): global status_presence