WIP updates

This commit is contained in:
Sacha Weatherstone
2022-11-27 22:50:46 +10:00
parent a9561fe622
commit e457cef3da
79 changed files with 2100 additions and 1284 deletions

View File

@@ -0,0 +1,22 @@
import { IsArray, IsBoolean, IsNumber, IsString } from "class-validator";
import type { RasterSource } from "@app/core/stores/appStore.js";
export class MapValidation {
@IsArray()
rasterSources: MapValidation_RasterSources[];
}
export class MapValidation_RasterSources implements RasterSource {
@IsBoolean()
enabled: boolean;
@IsString()
title: string;
// @IsUrl()
tiles: string[];
@IsNumber()
tileSize: number;
}

View File

@@ -1,4 +1,4 @@
import { IsBoolean, IsEnum } from "class-validator";
import { IsBoolean, IsEnum, IsInt } from "class-validator";
import { Protobuf } from "@meshtastic/meshtasticjs";
@@ -11,4 +11,10 @@ export class DeviceValidation implements Protobuf.Config_DeviceConfig {
@IsBoolean()
debugLogEnabled: boolean;
@IsInt()
buttonGpio: number;
@IsInt()
buzzerGpio: number;
}

View File

@@ -20,4 +20,7 @@ export class DisplayValidation implements Protobuf.Config_DisplayConfig {
@IsEnum(Protobuf.Config_DisplayConfig_DisplayUnits)
units: Protobuf.Config_DisplayConfig_DisplayUnits;
@IsEnum(Protobuf.Config_DisplayConfig_OledType)
oled: Protobuf.Config_DisplayConfig_OledType;
}

View File

@@ -6,14 +6,11 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
@IsBoolean()
wifiEnabled: boolean;
@IsEnum(Protobuf.Config_NetworkConfig_WiFiMode)
wifiMode: Protobuf.Config_NetworkConfig_WiFiMode;
@Length(0, 33) //min 1
@Length(1, 33)
@IsOptional({})
wifiSsid: string;
@Length(0, 64) //min 8
@Length(8, 64)
@IsOptional()
wifiPsk: string;
@@ -26,7 +23,7 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
@IsEnum(Protobuf.Config_NetworkConfig_EthMode)
ethMode: Protobuf.Config_NetworkConfig_EthMode;
ethConfig: NetworkValidation_IpV4Config;
ipv4Config: NetworkValidation_IpV4Config;
}
export class NetworkValidation_IpV4Config

View File

@@ -24,6 +24,12 @@ export class PositionValidation implements Protobuf.Config_PositionConfig {
@IsInt()
positionFlags: number;
@IsInt()
rxGpio: number;
@IsInt()
txGpio: number;
// fixed position fields
@IsNumber()
fixedAlt: number;

View File

@@ -1,4 +1,4 @@
import { IsInt } from "class-validator";
import { IsBoolean, IsInt } from "class-validator";
import type { Protobuf } from "@meshtastic/meshtasticjs";
@@ -13,9 +13,15 @@ export class ExternalNotificationValidation
@IsInt()
output: number;
@IsBoolean()
active: boolean;
@IsBoolean()
alertMessage: boolean;
@IsBoolean()
alertBell: boolean;
@IsBoolean()
usePwm: boolean;
}