Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MQTT settings #252

Merged
merged 10 commits into from
Jun 26, 2024
5 changes: 4 additions & 1 deletion src/components/PageComponents/ModuleConfig/MQTT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ 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
4 changes: 3 additions & 1 deletion src/validation/moduleConfig/mqtt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Message } from "@bufbuild/protobuf";
import type { Protobuf } from "@meshtastic/js";
import { IsBoolean, IsString, Length, IsNumber } from "class-validator";
import { IsBoolean, IsString, Length, IsNumber, IsOptional } from "class-validator";

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

@IsNumber()
@IsOptional()
positionPrecision: number;
}