X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=go%2Fr3-netstatus%2Fmain.go;h=a15c4ba68457b062cc149070038cc8c090fad27e;hb=d660271629ff32c40cff4fdff4449a39fe950159;hp=c565df2aba9df6b73526de135a983fd35e00dec7;hpb=3f91a25fbd163a5c2a0a1c4e17aeafb332585eaf;p=svn42.git diff --git a/go/r3-netstatus/main.go b/go/r3-netstatus/main.go index c565df2..a15c4ba 100644 --- a/go/r3-netstatus/main.go +++ b/go/r3-netstatus/main.go @@ -111,6 +111,8 @@ func EventToXMPP(bot *r3xmppbot.XmppBot, events <- chan interface{}, xmpp_presen last_frontdoor_ajar = event case r3events.BackdoorAjarUpdate: xmpp_presence_events_chan <- r3xmppbot.XMPPMsgEvent{Msg: fmt.Sprintf("Backdoor is %s (%s)",IfThenElseStr(event.Shut,"now shut.","ajar!"),time.Unix(event.Ts,0).String()), DistributeLevel: r3xmppbot.R3OnlineOnlyInfo, RememberAsStatus: false} + case r3events.GasLeakAlert: + xmpp_presence_events_chan <- r3xmppbot.XMPPMsgEvent{Msg: fmt.Sprintf("ALERT !! GasLeak Detected !!! (%s)", time.Unix(event.Ts,0).String()), DistributeLevel: r3xmppbot.R3NeverInfo, RememberAsStatus: false} case r3events.BoreDoomButtonPressEvent: xmpp_presence_events_chan <- r3xmppbot.XMPPMsgEvent{Msg: button_msg, DistributeLevel: r3xmppbot.R3OnlineOnlyInfo} xmpp_presence_events_chan <- button_status @@ -121,7 +123,7 @@ func EventToXMPP(bot *r3xmppbot.XmppBot, events <- chan interface{}, xmpp_presen last_buttonpress = 0 } // Try to XMPP Ping the server and if that fails, quit XMPPBot - if bot.PingServer(3500) == false { return } + if bot.PingServer(900) == false && bot.PingServer(900) == false && bot.PingServer(900) == false && bot.PingServer(900) == false{ return } case r3events.DoorProblemEvent: xmpp_presence_events_chan <- r3xmppbot.XMPPMsgEvent{Msg: fmt.Sprintf("Door Problem: %s. SeverityLevel: %d (%s)",event.Problem, event.Severity, time.Unix(event.Ts,0).String()), DistributeLevel: r3xmppbot.R3OnlineOnlyInfo, RememberAsStatus: false} }