mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-05 23:15:07 -06:00
26 lines
517 B
Go
26 lines
517 B
Go
package services
|
|
|
|
import (
|
|
"github.com/Xevion/go-ha/internal/connect"
|
|
)
|
|
|
|
type InputButton struct {
|
|
conn *connect.HAConnection
|
|
}
|
|
|
|
// Press presses an input button entity.
|
|
func (ib InputButton) Press(entityId string) error {
|
|
req := NewBaseServiceRequest(entityId)
|
|
req.Domain = "input_button"
|
|
req.Service = "press"
|
|
|
|
return ib.conn.WriteMessage(req)
|
|
}
|
|
|
|
func (ib InputButton) Reload() error {
|
|
req := NewBaseServiceRequest("")
|
|
req.Domain = "input_button"
|
|
req.Service = "reload"
|
|
return ib.conn.WriteMessage(req)
|
|
}
|