Browse Source

Add new config options

pull/110/head
Sacha Weatherstone 3 years ago
parent
commit
3dbce3fe1b
  1. 6
      src/components/PageComponents/Config/Device.tsx
  2. 12
      src/components/PageComponents/ModuleConfig/MQTT.tsx
  3. 3
      src/validation/config/device.ts
  4. 6
      src/validation/moduleConfig/mqtt.ts

6
src/components/PageComponents/Config/Device.tsx

@ -108,6 +108,12 @@ export const Device = (): JSX.Element => {
label: "Double Tap as Button Press", label: "Double Tap as Button Press",
description: description:
"Require a double tap of the button to send a button press" "Require a double tap of the button to send a button press"
},
{
type: "toggle",
name: "isManaged",
label: "Managed",
description: "Is this device managed by an external application"
} }
] ]
} }

12
src/components/PageComponents/ModuleConfig/MQTT.tsx

@ -91,6 +91,18 @@ export const MQTT = (): JSX.Element => {
fieldName: "enabled" fieldName: "enabled"
} }
] ]
},
{
type: "toggle",
name: "tlsEnabled",
label: "TLS Enabled",
description: "Enable or disable TLS",
},
{
type: "text",
name: "root",
label: "Root",
description: "Root topic to publish/subscribe to",
} }
] ]
} }

3
src/validation/config/device.ts

@ -28,4 +28,7 @@ export class DeviceValidation
@IsBoolean() @IsBoolean()
doubleTapAsButtonPress: boolean; doubleTapAsButtonPress: boolean;
@IsBoolean()
isManaged: boolean;
} }

6
src/validation/moduleConfig/mqtt.ts

@ -23,4 +23,10 @@ export class MQTTValidation
@IsBoolean() @IsBoolean()
jsonEnabled: boolean; jsonEnabled: boolean;
@IsBoolean()
tlsEnabled: boolean;
@Length(0, 30)
root: string;
} }

Loading…
Cancel
Save