Skip to content

Commit

Permalink
Merge pull request #252 from Hunter275/issue-251-mqtt-saving
Browse files Browse the repository at this point in the history
Fix MQTT settings
  • Loading branch information
Hunter275 authored Jun 26, 2024
2 parents 0dddf6a + 8893a19 commit 2566395
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"enabled": true
},
"files": {
"ignoreUnknown": true
"ignoreUnknown": true,
"ignore": ["vercel.json"]
},
"vcs": {
"enabled": true,
Expand Down
8 changes: 7 additions & 1 deletion src/components/PageComponents/ModuleConfig/MQTT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ export const MQTT = (): JSX.Element => {
new Protobuf.ModuleConfig.ModuleConfig({
payloadVariant: {
case: "mqtt",
value: data,
value: {
...data,
mapReportSettings:
new Protobuf.ModuleConfig.ModuleConfig_MapReportSettings(
data.mapReportSettings,
),
},
},
}),
);
Expand Down
10 changes: 9 additions & 1 deletion src/validation/moduleConfig/mqtt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import { IsBoolean, IsNumber, IsString, Length } from "class-validator";
import {
IsBoolean,
IsNumber,
IsOptional,
IsString,
Length,
} from "class-validator";

export class MqttValidation
implements
Expand Down Expand Up @@ -47,8 +53,10 @@ export class MqttValidationMapReportSettings
Omit<Protobuf.ModuleConfig.ModuleConfig_MapReportSettings, keyof Message>
{
@IsNumber()
@IsOptional()
publishIntervalSecs: number;

@IsNumber()
@IsOptional()
positionPrecision: number;
}
6 changes: 1 addition & 5 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"github": {
"silent": true
}
}
{ "github": { "silent": true } }

0 comments on commit 2566395

Please sign in to comment.