mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 01:15:10 -06:00
add zwavejs service
This commit is contained in:
@@ -25,7 +25,8 @@ func BuildService[
|
||||
Number |
|
||||
Scene |
|
||||
TTS |
|
||||
Vacuum,
|
||||
Vacuum |
|
||||
ZWaveJS,
|
||||
](conn *ws.WebsocketWriter, ctx context.Context) *T {
|
||||
return &T{conn: conn, ctx: ctx}
|
||||
}
|
||||
|
||||
29
internal/services/zwavejs.go
Normal file
29
internal/services/zwavejs.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
ws "saml.dev/gome-assistant/internal/websocket"
|
||||
)
|
||||
|
||||
/* Structs */
|
||||
|
||||
type ZWaveJS struct {
|
||||
conn *ws.WebsocketWriter
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
/* Public API */
|
||||
|
||||
// ZWaveJS bulk_set_partial_config_parameters service.
|
||||
func (zw ZWaveJS) BulkSetPartialConfigParam(entityId string, parameter int, value any) {
|
||||
req := NewBaseServiceRequest(entityId)
|
||||
req.Domain = "zwave_js"
|
||||
req.Service = "bulk_set_partial_config_parameters"
|
||||
req.ServiceData = map[string]any{
|
||||
"parameter": parameter,
|
||||
"value": value,
|
||||
}
|
||||
|
||||
zw.conn.WriteMessage(req, zw.ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user