added LoopState datatype for more precise control

This commit is contained in:
2025-08-30 15:23:33 +02:00
parent 95d2a1e1a4
commit 6fc6cec502
4 changed files with 86 additions and 10 deletions

View File

@ -47,7 +47,7 @@ func SendCommand[T any](socket string, cmd *Command) (*Response[T], error) {
}
func GetProperty[T any](socket string, propertyName string) (T, error) {
cmd := &Command{[]interface{}{"get_property", propertyName}}
cmd := &Command{[]any{"get_property", propertyName}}
resp, err := SendCommand[T](socket, cmd)
if err != nil {
return *new(T), err
@ -61,7 +61,7 @@ func GetProperty[T any](socket string, propertyName string) (T, error) {
}
func SetProperty[T any](socket string, propertyName string, propertyValue T) error {
cmd := &Command{[]interface{}{"set_property", propertyName, propertyValue}}
cmd := &Command{[]any{"set_property", propertyName, propertyValue}}
resp, err := SendCommand[T](socket, cmd)
if err != nil {
return err