mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-07 11:15:14 -06:00
Return Service errors
Additionally, removed the context that gets passed into the Services but isn't used in one of them. The websockets APIs also don't have any use for context.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
ws "saml.dev/gome-assistant/internal/websocket"
|
||||
)
|
||||
|
||||
@@ -10,13 +8,12 @@ import (
|
||||
|
||||
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) {
|
||||
func (zw ZWaveJS) BulkSetPartialConfigParam(entityId string, parameter int, value any) error {
|
||||
req := NewBaseServiceRequest(entityId)
|
||||
req.Domain = "zwave_js"
|
||||
req.Service = "bulk_set_partial_config_parameters"
|
||||
@@ -25,5 +22,5 @@ func (zw ZWaveJS) BulkSetPartialConfigParam(entityId string, parameter int, valu
|
||||
"value": value,
|
||||
}
|
||||
|
||||
zw.conn.WriteMessage(req, zw.ctx)
|
||||
return zw.conn.WriteMessage(req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user