Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MessagePubHandler mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) { switch { case strings.Contains(msg.Topic(), "/switch/basic/"): MessageUpdateStatus(msg.Payload()) } }
Functions ¶
func DefaultSubscribeHandler ¶
func MessageUpdateStatus ¶
func UpdateStatus ¶
func UpdateStatus(w http.ResponseWriter, r *http.Request)
Types ¶
type UpdateStatusRequest ¶
type UpdateStatusRequest struct { MoistureValue int `json:"moistureValue"` Mode string `json:"mode"` Moistures []struct { MoistureValue float64 `json:"vl"` SensorPin int `json:"seP"` LEDpin int `json:"leP"` SensorName string `json:"seN"` } `json:"moistures"` Switchs []struct { Value bool `json:"vl"` ID int `json:"id"` Uuid string `json:"uuid"` Pin int `json:"swP"` Name string `json:"swN"` } `json:"switchs"` Humiditys []struct { HumidityValue float64 `json:"hVl"` Temperature float64 `json:"tVl"` SensorPin int `json:"seP"` SensorName string `json:"seN"` } `json:"humiditys"` }
Click to show internal directories.
Click to hide internal directories.