Added automation for door that temporarily sets presence (15 min) if no one is present yet
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -23,6 +23,10 @@ type Message struct {
|
||||
Updated int64 `json:"updated"`
|
||||
}
|
||||
|
||||
func (p *Presence) Current() bool {
|
||||
return p.presence
|
||||
}
|
||||
|
||||
func (p *Presence) devicePresenceHandler(client paho.Client, msg paho.Message) {
|
||||
name := strings.Split(msg.Topic(), "/")[2]
|
||||
|
||||
@@ -48,8 +52,6 @@ func (p *Presence) devicePresenceHandler(client paho.Client, msg paho.Message) {
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Setting overall presence: %t\n", present)
|
||||
|
||||
if p.presence != present {
|
||||
p.presence = present
|
||||
|
||||
|
||||
Reference in New Issue
Block a user