added LoopState datatype for more precise control
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user