parent
06d87ea689
commit
db1ac7ffd6
|
@ -33,6 +33,10 @@ func (c *RestClient) GetState(entityId string) (StateData, error) {
|
|||
|
||||
func (c *RestClient) CallService(entityId string, service string, extras ...map[string]any) error {
|
||||
domain := strings.Split(entityId, ".")[0]
|
||||
return c.CallServiceManual(domain, entityId, service, extras...)
|
||||
}
|
||||
|
||||
func (c *RestClient) CallServiceManual(domain string, entityId string, service string, extras ...map[string]any) error {
|
||||
data := map[string]any{
|
||||
"entity_id": entityId,
|
||||
}
|
||||
|
|
|
@ -33,11 +33,15 @@ var Domains = struct {
|
|||
Switch string
|
||||
Lock string
|
||||
Cover string
|
||||
Homeassistant string
|
||||
Group string
|
||||
}{
|
||||
Light: "light",
|
||||
Switch: "switch",
|
||||
Lock: "lock",
|
||||
Cover: "cover",
|
||||
Homeassistant: "homeassistant",
|
||||
Group: "group",
|
||||
}
|
||||
|
||||
// Home Assistant services
|
||||
|
|
Loading…
Reference in New Issue