add notify service

This commit is contained in:
Sam Lewis
2022-11-06 15:00:39 -05:00
parent e3e7889574
commit ba9132745e
5 changed files with 49 additions and 3 deletions

View File

@@ -17,7 +17,8 @@ func BuildService[
InputButton |
InputDatetime |
InputText |
InputNumber,
InputNumber |
Notify,
](conn *websocket.Conn, ctx context.Context) *T {
return &T{conn: conn, ctx: ctx}
}
@@ -29,7 +30,7 @@ type BaseServiceRequest struct {
Service string `json:"service"`
ServiceData map[string]any `json:"service_data,omitempty"`
Target struct {
EntityId string `json:"entity_id"`
EntityId string `json:"entity_id,omitempty"`
} `json:"target,omitempty"`
}
@@ -42,6 +43,5 @@ func NewBaseServiceRequest(entityId string) BaseServiceRequest {
if entityId != "" {
bsr.Target.EntityId = entityId
}
id += 1
return bsr
}