From: Bernhard Tittelbach Date: Sun, 13 Oct 2013 23:36:47 +0000 (+0000) Subject: button X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=91ed9fe7c53c26cad5771ef4727da01eae932fa0;p=svn42.git button --- diff --git a/go/r3-eventbroker_zmq/presence.go b/go/r3-eventbroker_zmq/presence.go index 01087ba..3677b27 100644 --- a/go/r3-eventbroker_zmq/presence.go +++ b/go/r3-eventbroker_zmq/presence.go @@ -10,7 +10,7 @@ import ( ) func MetaEventRoutine_Presence(ps *pubsub.PubSub, movement_timeout, button_timeout int64) { - //~ var last_door_cmd *r3events.DoorCommandEvent + var last_door_cmd *r3events.DoorCommandEvent var last_presence bool var last_event_indicating_presence, last_frontlock_use int64 var front_locked, front_shut, back_shut bool = true, true, true @@ -40,7 +40,7 @@ func MetaEventRoutine_Presence(ps *pubsub.PubSub, movement_timeout, button_timeo new_presence = true last_event_indicating_presence = evnt.Ts case r3events.DoorCommandEvent: - //~ last_door_cmd = &evnt + last_door_cmd = &evnt case r3events.DoorLockUpdate: front_locked = evnt.Locked last_frontlock_use = evnt.Ts @@ -64,6 +64,8 @@ func MetaEventRoutine_Presence(ps *pubsub.PubSub, movement_timeout, button_timeo //... skip state check .. we had a definite presence event } else if any_door_unlocked || any_door_ajar { new_presence = true + } else if last_door_cmd.Using == "Button" { + new_presence = true } else { new_presence = false }