fix(module,cast): jsonize device attributes

This commit is contained in:
wpetit 2023-02-17 13:03:10 +01:00
parent 4606d7a08d
commit 673586c2f7
1 changed files with 11 additions and 11 deletions

View File

@ -12,26 +12,26 @@ import (
) )
type Device struct { type Device struct {
UUID string `goja:"uuid"` UUID string `goja:"uuid" json:"uuid"`
Host net.IP `goja:"host"` Host net.IP `goja:"host" json:"host"`
Port int `goja:"port"` Port int `goja:"port" json:"port"`
Name string `goja:"name"` Name string `goja:"name" json:"name"`
} }
type DeviceStatus struct { type DeviceStatus struct {
CurrentApp DeviceStatusCurrentApp `goja:"currentApp"` CurrentApp DeviceStatusCurrentApp `goja:"currentApp" json:"currentApp"`
Volume DeviceStatusVolume `goja:"volume"` Volume DeviceStatusVolume `goja:"volume" json:"volume"`
} }
type DeviceStatusCurrentApp struct { type DeviceStatusCurrentApp struct {
ID string `goja:"id"` ID string `goja:"id" json:"id"`
DisplayName string `goja:"displayName"` DisplayName string `goja:"displayName" json:"displayName"`
StatusText string `goja:"statusText"` StatusText string `goja:"statusText" json:"statusText"`
} }
type DeviceStatusVolume struct { type DeviceStatusVolume struct {
Level float64 `goja:"level"` Level float64 `goja:"level" json:"level"`
Muted bool `goja:"muted"` Muted bool `goja:"muted" json:"muted"`
} }
const ( const (