Add more device fields (#111)

These fields will be used to improve acceptance tests.
This commit is contained in:
Joshua Spence
2023-02-28 20:20:02 +11:00
committed by GitHub
parent 1a8ebcf405
commit dd2fd56a6f
2 changed files with 5 additions and 1 deletions

View File

@@ -152,7 +152,9 @@ func NewResource(structName string, resourcePath string) *Resource {
case resource.StructName == "Device":
baseType.Fields[" MAC"] = NewFieldInfo("MAC", "mac", "string", "", true, false, "")
baseType.Fields["Adopted"] = NewFieldInfo("Adopted", "adopted", "bool", "", false, false, "")
baseType.Fields["Model"] = NewFieldInfo("Model", "model", "string", "", true, false, "")
baseType.Fields["State"] = NewFieldInfo("State", "state", "DeviceState", "", false, false, "")
baseType.Fields["Type"] = NewFieldInfo("Type", "type", "string", "", true, false, "")
case resource.StructName == "User":
baseType.Fields[" IP"] = NewFieldInfo("IP", "ip", "string", "non-generated field", true, false, "")
baseType.Fields[" DevIdOverride"] = NewFieldInfo("DevIdOverride", "dev_id_override", "int", "non-generated field", true, false, "")

View File

@@ -76,6 +76,7 @@ type Device struct {
MapID string `json:"map_id,omitempty"`
MeshStaVapEnabled bool `json:"mesh_sta_vap_enabled,omitempty"`
MgmtNetworkID string `json:"mgmt_network_id,omitempty"` // [\d\w]+
Model string `json:"model,omitempty"`
Name string `json:"name,omitempty"` // .{0,128}
OutdoorModeOverride string `json:"outdoor_mode_override,omitempty"` // default|on|off
OutletEnabled bool `json:"outlet_enabled,omitempty"`
@@ -94,6 +95,7 @@ type Device struct {
StpPriority string `json:"stp_priority,omitempty"` // 0|4096|8192|12288|16384|20480|24576|28672|32768|36864|40960|45056|49152|53248|57344|61440
StpVersion string `json:"stp_version,omitempty"` // stp|rstp|disabled
SwitchVLANEnabled bool `json:"switch_vlan_enabled,omitempty"`
Type string `json:"type,omitempty"`
UbbPairName string `json:"ubb_pair_name,omitempty"` // .{1,128}
Volume int `json:"volume,omitempty"` // [0-9]|[1-9][0-9]|100
WLANOverrides []DeviceWLANOverrides `json:"wlan_overrides,omitempty"`