Documentation ¶
Index ¶
- Variables
- func CreateMqtt(server string, callback mqtt.MessageHandler)
- func Publish(topic string, v any, retained bool)
- func PublishHvac(deviceId string, config *homeassistant.Hvac)
- func PublishSensor(deviceId string, config *homeassistant.Sensor, sensor string)
- func PublishState()
- func PublishStatus(deviceId string, status *Status)
- type Server
- type Status
- type Update
Constants ¶
This section is empty.
Variables ¶
View Source
var CommandTopicRegex = regexp.MustCompile(".*/(?P<deviceId>\\S+)/set")
View Source
var DefaultClient = http.Client{ Timeout: 10 * time.Second, }
Functions ¶
func CreateMqtt ¶
func CreateMqtt(server string, callback mqtt.MessageHandler)
func PublishHvac ¶
func PublishHvac(deviceId string, config *homeassistant.Hvac)
func PublishSensor ¶
func PublishSensor(deviceId string, config *homeassistant.Sensor, sensor string)
func PublishState ¶
func PublishState()
func PublishStatus ¶
Types ¶
type Server ¶
func (*Server) SetTargetTemp ¶
type Status ¶
type Status struct { Energy float64 `json:"energy,omitempty"` StoredEnergy float64 `json:"stored_energy,omitempty"` TargetTemp float64 `json:"target_temp,omitempty"` CurrentTemp float64 `json:"current_temp,omitempty"` Power float64 `json:"power,omitempty"` MaxPower float64 `json:"max_power,omitempty"` Mode string `json:"mode,omitempty"` Action string `json:"action,omitempty"` }
Click to show internal directories.
Click to hide internal directories.