X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=go%2Fr3-netstatus%2Fwebstatus.go;h=3da6e7df694e14b9775bd8016d77a416a3cce74f;hb=a87c91b7d4544703879b7ef6e472b863765e3949;hp=53ff92d73551602bc60e1a79067bd7fc49ecef9a;hpb=b7182b7f1d5dae86d81310beaa6ce6d693696572;p=svn42.git diff --git a/go/r3-netstatus/webstatus.go b/go/r3-netstatus/webstatus.go index 53ff92d..3da6e7d 100644 --- a/go/r3-netstatus/webstatus.go +++ b/go/r3-netstatus/webstatus.go @@ -9,7 +9,8 @@ import ( "net/http" "net/url" "time" - r3events "svn.spreadspace.org/realraum/go.svn/r3-eventbroker_zmq/r3events" + "fmt" + r3events "svn.spreadspace.org/realraum/go.svn/r3events" ) @@ -80,6 +81,9 @@ func EventToWeb(ps *pubsub.PubSub) { case r3events.PresenceUpdate: statusstate.present = event.Present publishStateToWeb() + case r3events.BackdoorAjarUpdate: + spaceapidata.MergeInSensor(spaceapi.MakeDoorLockSensor("HintertorwaechterAjarSensor", "Hintertürkontakt", event.Shut)) + publishStateToWeb() case r3events.DoorAjarUpdate: spaceapidata.MergeInSensor(spaceapi.MakeDoorLockSensor("TorwaechterAjarSensor", "Türkontakt", event.Shut)) publishStateToWeb() @@ -91,9 +95,21 @@ func EventToWeb(ps *pubsub.PubSub) { spaceapidata.AddSpaceEvent("BoreDOOMButton", "check-in", "The button has been pressed") publishStateToWeb() case r3events.TempSensorUpdate: - spaceapidata.MergeInSensor(spaceapi.MakeTempCSensor("Temp0","Decke", event.Value)) + var tempsensorlocation string + switch event.Sensorindex { + case 0: + tempsensorlocation = "LoTHR" + case 1: + tempsensorlocation = "CX" + default: + tempsensorlocation = "Sonstwo" + } + spaceapidata.MergeInSensor(spaceapi.MakeTempCSensor(fmt.Sprintf("Temp%d",event.Sensorindex),tempsensorlocation, event.Value)) case r3events.IlluminationSensorUpdate: - spaceapidata.MergeInSensor(spaceapi.MakeIlluminationSensor("Photodiode","Decke","1024V/5V", event.Value)) + spaceapidata.MergeInSensor(spaceapi.MakeIlluminationSensor("Photodiode","LoTHR","1024V/5V", event.Value)) + case r3events.GasLeakAlert: + spaceapidata.AddSpaceEvent("GasLeak", "alert", "GasLeak Alert has been triggered") + publishStateToWeb() } } }