Use rome and initial format

This commit is contained in:
Sacha Weatherstone
2023-07-09 13:59:31 +10:00
parent a65bc37be5
commit 20ac657b51
90 changed files with 3350 additions and 3092 deletions
+17 -17
View File
@@ -18,12 +18,12 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
...data,
settings: {
...data.settings,
psk: toByteArray(data.settings.psk ?? "")
}
psk: toByteArray(data.settings.psk ?? ""),
},
});
connection?.setChannel(channel).then(() => {
toast({
title: `Saved Channel: ${channel.settings?.name}`
title: `Saved Channel: ${channel.settings?.name}`,
});
addChannel(channel);
});
@@ -39,9 +39,9 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
...{
settings: {
...channel?.settings,
psk: fromByteArray(channel?.settings?.psk ?? new Uint8Array(0))
}
}
psk: fromByteArray(channel?.settings?.psk ?? new Uint8Array(0)),
},
},
}}
fieldGroups={[
{
@@ -54,8 +54,8 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
label: "Role",
description: "Description",
properties: {
enumValue: Protobuf.Channel_Role
}
enumValue: Protobuf.Channel_Role,
},
},
{
type: "password",
@@ -64,40 +64,40 @@ export const Channel = ({ channel }: SettingsPanelProps): JSX.Element => {
description: "Description",
properties: {
// act
}
},
},
{
type: "number",
name: "settings.channelNum",
label: "Channel Number",
description: "Description"
description: "Description",
},
{
type: "text",
name: "settings.name",
label: "Name",
description: "Description"
description: "Description",
},
{
type: "number",
name: "settings.id",
label: "ID",
description: "Description"
description: "Description",
},
{
type: "toggle",
name: "settings.uplinkEnabled",
label: "Uplink Enabled",
description: "Description"
description: "Description",
},
{
type: "toggle",
name: "settings.downlinkEnabled",
label: "Downlink Enabled",
description: "Description"
}
]
}
description: "Description",
},
],
},
]}
/>
);
@@ -11,9 +11,9 @@ export const Bluetooth = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "bluetooth",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const Bluetooth = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Enabled",
description: "Enable or disable Bluetooth"
description: "Enable or disable Bluetooth",
},
{
type: "select",
@@ -39,13 +39,13 @@ export const Bluetooth = (): JSX.Element => {
description: "Pin selection behaviour.",
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
enumValue: Protobuf.Config_BluetoothConfig_PairingMode,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "number",
@@ -57,16 +57,16 @@ export const Bluetooth = (): JSX.Element => {
fieldName: "mode",
selector:
Protobuf.Config_BluetoothConfig_PairingMode.FIXED_PIN,
invert: true
invert: true,
},
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {}
}
]
}
properties: {},
},
],
},
]}
/>
);
+29 -17
View File
@@ -1,7 +1,7 @@
import type { DeviceValidation } from "@app/validation/config/device.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Device = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Device = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "device",
value: data
}
})
value: data,
},
}),
);
};
@@ -33,33 +33,33 @@ export const Device = (): JSX.Element => {
description: "What role the device performs on the mesh",
properties: {
enumValue: Protobuf.Config_DeviceConfig_Role,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "toggle",
name: "serialEnabled",
label: "Serial Output Enabled",
description: "Enable the device's serial console"
description: "Enable the device's serial console",
},
{
type: "toggle",
name: "debugLogEnabled",
label: "Enabled Debug Log",
description:
"Output debugging information to the device's serial port (auto disables when serial client is connected)"
"Output debugging information to the device's serial port (auto disables when serial client is connected)",
},
{
type: "number",
name: "buttonGpio",
label: "Button Pin",
description: "Button pin override"
description: "Button pin override",
},
{
type: "number",
name: "buzzerGpio",
label: "Buzzer Pin",
description: "Buzzer pin override"
description: "Buzzer pin override",
},
{
type: "select",
@@ -68,8 +68,8 @@ export const Device = (): JSX.Element => {
description: "How to handle rebroadcasting",
properties: {
enumValue: Protobuf.Config_DeviceConfig_RebroadcastMode,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "number",
@@ -77,11 +77,23 @@ export const Device = (): JSX.Element => {
label: "Node Info Broadcast Interval",
description: "How often to broadcast node info",
properties: {
suffix: "Seconds"
}
}
]
}
suffix: "Seconds",
},
},
{
type: "toggle",
name: "doubleTapAsButtonPress",
label: "Double Tap as Button Press",
description: "Treat double tap as button press",
},
{
type: "toggle",
name: "isManaged",
label: "Managed",
description: "Is this device managed by a mesh administator",
},
],
},
]}
/>
);
@@ -1,7 +1,7 @@
import type { DisplayValidation } from "@app/validation/config/display.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Display = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Display = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "display",
value: data
}
})
value: data,
},
}),
);
};
@@ -32,8 +32,8 @@ export const Display = (): JSX.Element => {
label: "Screen Timeout",
description: "Turn off the display after this long",
properties: {
suffix: "seconds"
}
suffix: "seconds",
},
},
{
type: "select",
@@ -41,26 +41,26 @@ export const Display = (): JSX.Element => {
label: "GPS Display Units",
description: "Coordinate display format",
properties: {
enumValue: Protobuf.Config_DisplayConfig_GpsCoordinateFormat
}
enumValue: Protobuf.Config_DisplayConfig_GpsCoordinateFormat,
},
},
{
type: "number",
name: "autoScreenCarouselSecs",
label: "Carousel Delay",
description: "How fast to cycle through windows"
description: "How fast to cycle through windows",
},
{
type: "toggle",
name: "compassNorthTop",
label: "Compass North Top",
description: "Fix north to the top of compass"
description: "Fix north to the top of compass",
},
{
type: "toggle",
name: "flipScreen",
label: "Flip Screen",
description: "Flip display 180 degrees"
description: "Flip display 180 degrees",
},
{
type: "select",
@@ -69,8 +69,8 @@ export const Display = (): JSX.Element => {
description: "Display metric or imperial units",
properties: {
enumValue: Protobuf.Config_DisplayConfig_DisplayUnits,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "select",
@@ -78,8 +78,8 @@ export const Display = (): JSX.Element => {
label: "OLED Type",
description: "Type of OLED screen attached to the device",
properties: {
enumValue: Protobuf.Config_DisplayConfig_OledType
}
enumValue: Protobuf.Config_DisplayConfig_OledType,
},
},
{
type: "select",
@@ -88,17 +88,23 @@ export const Display = (): JSX.Element => {
description: "Screen layout variant",
properties: {
enumValue: Protobuf.Config_DisplayConfig_DisplayMode,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "toggle",
name: "headingBold",
label: "Bold Heading",
description: "Bolden the heading text"
}
]
}
description: "Bolden the heading text",
},
{
type: "toggle",
name: "wakeOnTapOrMotion",
label: "Wake on Tap or Motion",
description: "Wake the device on tap or motion",
},
],
},
]}
/>
);
+39 -39
View File
@@ -11,9 +11,9 @@ export const LoRa = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "lora",
value: data
}
})
value: data,
},
}),
);
};
@@ -32,22 +32,22 @@ export const LoRa = (): JSX.Element => {
label: "Region",
description: "Sets the region for your node",
properties: {
enumValue: Protobuf.Config_LoRaConfig_RegionCode
}
enumValue: Protobuf.Config_LoRaConfig_RegionCode,
},
},
{
type: "number",
name: "hopLimit",
label: "Hop Limit",
description: "Maximum number of hops"
description: "Maximum number of hops",
},
{
type: "number",
name: "channelNum",
label: "Channel Number",
description: "LoRa channel number"
}
]
description: "LoRa channel number",
},
],
},
{
label: "Waveform Settings",
@@ -57,7 +57,7 @@ export const LoRa = (): JSX.Element => {
type: "toggle",
name: "usePreset",
label: "Use Preset",
description: "Use one of the predefined modem presets"
description: "Use one of the predefined modem presets",
},
{
type: "select",
@@ -66,13 +66,13 @@ export const LoRa = (): JSX.Element => {
description: "Modem preset to use",
disabledBy: [
{
fieldName: "usePreset"
}
fieldName: "usePreset",
},
],
properties: {
enumValue: Protobuf.Config_LoRaConfig_ModemPreset,
formatEnumName: true
}
formatEnumName: true,
},
},
{
type: "number",
@@ -82,12 +82,12 @@ export const LoRa = (): JSX.Element => {
disabledBy: [
{
fieldName: "usePreset",
invert: true
}
invert: true,
},
],
properties: {
suffix: "MHz"
}
suffix: "MHz",
},
},
{
type: "number",
@@ -98,12 +98,12 @@ export const LoRa = (): JSX.Element => {
disabledBy: [
{
fieldName: "usePreset",
invert: true
}
invert: true,
},
],
properties: {
suffix: "CPS"
}
suffix: "CPS",
},
},
{
type: "number",
@@ -113,11 +113,11 @@ export const LoRa = (): JSX.Element => {
disabledBy: [
{
fieldName: "usePreset",
invert: true
}
]
}
]
invert: true,
},
],
},
],
},
{
label: "Radio Settings",
@@ -127,7 +127,7 @@ export const LoRa = (): JSX.Element => {
type: "toggle",
name: "txEnabled",
label: "Tramsmit Enabled",
description: "Enable/Disable transmit (TX) from the LoRa radio"
description: "Enable/Disable transmit (TX) from the LoRa radio",
},
{
type: "number",
@@ -135,14 +135,14 @@ export const LoRa = (): JSX.Element => {
label: "Transmit Power",
description: "Max transmit power",
properties: {
suffix: "dBm"
}
suffix: "dBm",
},
},
{
type: "toggle",
name: "overrideDutyCycle",
label: "Override Duty Cycle",
description: "Override Duty Cycle"
description: "Override Duty Cycle",
},
{
type: "number",
@@ -151,14 +151,14 @@ export const LoRa = (): JSX.Element => {
description:
"Frequency offset to correct for crystal calibration errors",
properties: {
suffix: "Hz"
}
suffix: "Hz",
},
},
{
type: "toggle",
name: "sx126xRxBoostedGain",
label: "Boosted RX Gain",
description: "Boosted RX gain"
description: "Boosted RX gain",
},
{
type: "number",
@@ -166,11 +166,11 @@ export const LoRa = (): JSX.Element => {
label: "Override Frequency",
description: "Override frequency",
properties: {
suffix: "Hz"
}
}
]
}
suffix: "Hz",
},
},
],
},
]}
/>
);
@@ -14,11 +14,11 @@ export const Network = (): JSX.Element => {
value: {
...data,
ipv4Config: new Protobuf.Config_NetworkConfig_IpV4Config(
data.ipv4Config
)
}
}
})
data.ipv4Config,
),
},
},
}),
);
};
@@ -35,7 +35,7 @@ export const Network = (): JSX.Element => {
type: "toggle",
name: "wifiEnabled",
label: "Enabled",
description: "Enable or disable the WiFi radio"
description: "Enable or disable the WiFi radio",
},
{
type: "text",
@@ -44,9 +44,9 @@ export const Network = (): JSX.Element => {
description: "Network name",
disabledBy: [
{
fieldName: "wifiEnabled"
}
]
fieldName: "wifiEnabled",
},
],
},
{
type: "password",
@@ -55,11 +55,11 @@ export const Network = (): JSX.Element => {
description: "Network password",
disabledBy: [
{
fieldName: "wifiEnabled"
}
]
}
]
fieldName: "wifiEnabled",
},
],
},
],
},
{
label: "Ethernet Config",
@@ -69,9 +69,9 @@ export const Network = (): JSX.Element => {
type: "toggle",
name: "ethEnabled",
label: "Enabled",
description: "Enable or disable the Ethernet port"
}
]
description: "Enable or disable the Ethernet port",
},
],
},
{
label: "IP Config",
@@ -83,8 +83,8 @@ export const Network = (): JSX.Element => {
label: "Address Mode",
description: "Address assignment selection",
properties: {
enumValue: Protobuf.Config_NetworkConfig_AddressMode
}
enumValue: Protobuf.Config_NetworkConfig_AddressMode,
},
},
{
type: "text",
@@ -94,9 +94,9 @@ export const Network = (): JSX.Element => {
disabledBy: [
{
fieldName: "addressMode",
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP
}
]
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
},
],
},
{
type: "text",
@@ -106,9 +106,9 @@ export const Network = (): JSX.Element => {
disabledBy: [
{
fieldName: "addressMode",
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP
}
]
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
},
],
},
{
type: "text",
@@ -118,9 +118,9 @@ export const Network = (): JSX.Element => {
disabledBy: [
{
fieldName: "addressMode",
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP
}
]
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
},
],
},
{
type: "text",
@@ -130,11 +130,11 @@ export const Network = (): JSX.Element => {
disabledBy: [
{
fieldName: "addressMode",
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP
}
]
}
]
selector: Protobuf.Config_NetworkConfig_AddressMode.DHCP,
},
],
},
],
},
{
label: "NTP Config",
@@ -143,9 +143,9 @@ export const Network = (): JSX.Element => {
{
type: "text",
name: "ntpServer",
label: "NTP Server"
}
]
label: "NTP Server",
},
],
},
{
label: "Rsyslog Config",
@@ -154,10 +154,10 @@ export const Network = (): JSX.Element => {
{
type: "text",
name: "rsyslogServer",
label: "Rsyslog Server"
}
]
}
label: "Rsyslog Server",
},
],
},
]}
/>
);
@@ -1,7 +1,7 @@
import type { PositionValidation } from "@app/validation/config/position.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Position = (): JSX.Element => {
const { config, nodes, hardware, setWorkingConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Position = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "position",
value: data
}
})
value: data,
},
}),
);
};
@@ -31,20 +31,20 @@ export const Position = (): JSX.Element => {
name: "positionBroadcastSmartEnabled",
label: "Enable Smart Position",
description:
"Only send position when there has been a meaningful change in location"
"Only send position when there has been a meaningful change in location",
},
{
type: "toggle",
name: "fixedPosition",
label: "Fixed Position",
description:
"Don't report GPS position, but a manually-specified one"
"Don't report GPS position, but a manually-specified one",
},
{
type: "toggle",
name: "gpsEnabled",
label: "GPS Enabled",
description: "Enable the internal GPS module"
description: "Enable the internal GPS module",
},
{
type: "multiSelect",
@@ -52,22 +52,22 @@ export const Position = (): JSX.Element => {
label: "Position Flags",
description: "Configuration options for Position messages",
properties: {
enumValue: Protobuf.Config_PositionConfig_PositionFlags
}
enumValue: Protobuf.Config_PositionConfig_PositionFlags,
},
},
{
type: "number",
name: "rxGpio",
label: "Receive Pin",
description: "GPS Module RX pin override"
description: "GPS Module RX pin override",
},
{
type: "number",
name: "txGpio",
label: "Transmit Pin",
description: "GPS Module TX pin override"
}
]
description: "GPS Module TX pin override",
},
],
},
{
label: "Intervals",
@@ -77,22 +77,46 @@ export const Position = (): JSX.Element => {
type: "number",
name: "positionBroadcastSecs",
label: "Broadcast Interval",
description: "How often your position is sent out over the mesh"
description: "How often your position is sent out over the mesh",
},
{
type: "number",
name: "gpsUpdateInterval",
label: "GPS Update Interval",
description: "How often a GPS fix should be acquired"
description: "How often a GPS fix should be acquired",
},
{
type: "number",
name: "gpsAttemptTime",
label: "Fix Attempt Duration",
description: "How long the device will try to get a fix for"
}
]
}
description: "How long the device will try to get a fix for",
},
{
type: "number",
name: "broadcastSmartMinimumDistance",
label: "Smart Position Minimum Distance",
description:
"Minimum distance (in meters) that must be traveled before a position update is sent",
disabledBy: [
{
fieldName: "positionBroadcastSmartEnabled",
},
],
},
{
type: "number",
name: "broadcastSmartMinimumIntervalSecs",
label: "Smart Position Minimum Interval",
description:
"Minimum interval (in seconds) that must pass before a position update is sent",
disabledBy: [
{
fieldName: "positionBroadcastSmartEnabled",
},
],
},
],
},
]}
/>
);
+29 -23
View File
@@ -1,7 +1,7 @@
import type { PowerValidation } from "@app/validation/config/power.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Power = (): JSX.Element => {
const { config, setWorkingConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Power = (): JSX.Element => {
new Protobuf.Config({
payloadVariant: {
case: "power",
value: data
}
})
value: data,
},
}),
);
};
@@ -31,7 +31,7 @@ export const Power = (): JSX.Element => {
name: "isPowerSaving",
label: "Enable power saving mode",
description:
"Select if powered from a low-current source (i.e. solar), to minimize power consumption as much as possible."
"Select if powered from a low-current source (i.e. solar), to minimize power consumption as much as possible.",
},
{
type: "number",
@@ -40,14 +40,14 @@ export const Power = (): JSX.Element => {
description:
"Automatically shutdown node after this long when on battery, 0 for indefinite",
properties: {
suffix: "Seconds"
}
suffix: "Seconds",
},
},
{
type: "number",
name: "adcMultiplierOverride",
label: "ADC Multiplier Override ratio",
description: "Used for tweaking battery voltage reading"
description: "Used for tweaking battery voltage reading",
},
{
type: "number",
@@ -56,10 +56,16 @@ export const Power = (): JSX.Element => {
description:
"If the device does not receive a Bluetooth connection, the BLE radio will be disabled after this long",
properties: {
suffix: "Seconds"
}
}
]
suffix: "Seconds",
},
},
{
type: "number",
name: "deviceBatteryInaAddress",
label: "INA219 Address",
description: "Address of the INA219 battery monitor",
},
],
},
{
label: "Sleep Settings",
@@ -72,8 +78,8 @@ export const Power = (): JSX.Element => {
description:
"The device will enter super deep sleep after this time",
properties: {
suffix: "Seconds"
}
suffix: "Seconds",
},
},
{
type: "number",
@@ -82,8 +88,8 @@ export const Power = (): JSX.Element => {
description:
"How long the device will be in super deep sleep for",
properties: {
suffix: "Seconds"
}
suffix: "Seconds",
},
},
{
type: "number",
@@ -91,8 +97,8 @@ export const Power = (): JSX.Element => {
label: "Light Sleep Duration",
description: "How long the device will be in light sleep for",
properties: {
suffix: "Seconds"
}
suffix: "Seconds",
},
},
{
type: "number",
@@ -101,11 +107,11 @@ export const Power = (): JSX.Element => {
description:
"Minimum amount of time the device will stay awake for after receiving a packet",
properties: {
suffix: "Seconds"
}
}
]
}
suffix: "Seconds",
},
},
],
},
]}
/>
);
@@ -26,7 +26,7 @@ export const BLE = (): JSX.Element => {
setSelectedDevice(id);
const connection = new IBLEConnection(id);
await connection.connect({
device: BLEDevice
device: BLEDevice,
});
device.addConnection(connection);
subscribeAll(device, connection);
@@ -53,7 +53,7 @@ export const BLE = (): JSX.Element => {
onClick={() => {
void navigator.bluetooth
.requestDevice({
filters: [{ services: [Constants.serviceUUID] }]
filters: [{ services: [Constants.serviceUUID] }],
})
.then((device) => {
const exists = bleDevices.findIndex((d) => d.id === device.id);
@@ -19,18 +19,18 @@ export const HTTP = (): JSX.Element => {
}>({
defaultValues: {
ip: ["client.meshtastic.org", "localhost"].includes(
window.location.hostname
window.location.hostname,
)
? "meshtastic.local"
: window.location.hostname,
tls: location.protocol === "https:"
}
tls: location.protocol === "https:",
},
});
const TLSEnabled = useWatch({
control,
name: "tls",
defaultValue: location.protocol === "https:"
defaultValue: location.protocol === "https:",
});
const onSubmit = handleSubmit((data) => {
@@ -42,7 +42,7 @@ export const HTTP = (): JSX.Element => {
void connection.connect({
address: data.ip,
fetchInterval: 2000,
tls: data.tls
tls: data.tls,
});
device.addConnection(connection);
subscribeAll(device, connection);
@@ -35,7 +35,7 @@ export const Serial = (): JSX.Element => {
.connect({
port,
baudRate: undefined,
concurrentLogOutput: true
concurrentLogOutput: true,
})
.catch((e: Error) => console.log(`Unable to Connect: ${e.message}`));
device.addConnection(connection);
@@ -14,7 +14,7 @@ export interface ChannelChatProps {
export const ChannelChat = ({
messages,
channel,
to
to,
}: ChannelChatProps): JSX.Element => {
const { nodes } = useDevice();
@@ -2,7 +2,7 @@ import { Hashicon } from "@emeraldpay/hashicon-react";
import {
CircleEllipsisIcon,
AlertCircleIcon,
CheckCircle2Icon
CheckCircle2Icon,
} from "lucide-react";
import type { Protobuf } from "@meshtastic/meshtasticjs";
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
@@ -16,7 +16,7 @@ export interface MessageProps {
export const Message = ({
lastMsgSameUser,
message,
sender
sender,
}: MessageProps): JSX.Element => {
return lastMsgSameUser ? (
<div className="ml-5 flex">
@@ -47,7 +47,7 @@ export const Message = ({
<span className="mt-1 font-mono text-xs text-textSecondary">
{message.rxTime.toLocaleTimeString(undefined, {
hour: "2-digit",
minute: "2-digit"
minute: "2-digit",
})}
</span>
</div>
@@ -11,14 +11,14 @@ export interface MessageInputProps {
export const MessageInput = ({
to,
channel
channel,
}: MessageInputProps): JSX.Element => {
const {
connection,
setMessageState,
messageDraft,
setMessageDraft,
hardware
hardware,
} = useDevice();
const myNodeNum = hardware.myNodeNum;
@@ -33,8 +33,8 @@ export const MessageInput = ({
to as number,
myNodeNum,
id,
"ack"
)
"ack",
),
)
.catch((e: Types.PacketError) =>
setMessageState(
@@ -43,8 +43,8 @@ export const MessageInput = ({
to as number,
myNodeNum,
e.id,
e.error
)
e.error,
),
);
};
@@ -11,9 +11,9 @@ export const Audio = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "audio",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,13 +30,13 @@ export const Audio = (): JSX.Element => {
type: "toggle",
name: "codec2Enabled",
label: "Codec 2 Enabled",
description: "Enable Codec 2 audio encoding"
description: "Enable Codec 2 audio encoding",
},
{
type: "number",
name: "pttPin",
label: "PTT Pin",
description: "GPIO pin to use for PTT"
description: "GPIO pin to use for PTT",
},
{
type: "select",
@@ -44,35 +44,35 @@ export const Audio = (): JSX.Element => {
label: "Bitrate",
description: "Bitrate to use for audio encoding",
properties: {
enumValue: Protobuf.ModuleConfig_AudioConfig_Audio_Baud
}
enumValue: Protobuf.ModuleConfig_AudioConfig_Audio_Baud,
},
},
{
type: "number",
name: "i2sWs",
label: "i2S WS",
description: "GPIO pin to use for i2S WS"
description: "GPIO pin to use for i2S WS",
},
{
type: "number",
name: "i2sSd",
label: "i2S SD",
description: "GPIO pin to use for i2S SD"
description: "GPIO pin to use for i2S SD",
},
{
type: "number",
name: "i2sDin",
label: "i2S DIN",
description: "GPIO pin to use for i2S DIN"
description: "GPIO pin to use for i2S DIN",
},
{
type: "number",
name: "i2sSck",
label: "i2S SCK",
description: "GPIO pin to use for i2S SCK"
}
]
}
description: "GPIO pin to use for i2S SCK",
},
],
},
]}
/>
);
@@ -11,9 +11,9 @@ export const CannedMessage = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "cannedMessage",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,25 +30,25 @@ export const CannedMessage = (): JSX.Element => {
type: "toggle",
name: "rotary1Enabled",
label: "Rotary Encoder #1 Enabled",
description: "Enable the rotary encoder"
description: "Enable the rotary encoder",
},
{
type: "number",
name: "inputbrokerPinA",
label: "Encoder Pin A",
description: "GPIO Pin Value (1-39) For encoder port A"
description: "GPIO Pin Value (1-39) For encoder port A",
},
{
type: "number",
name: "inputbrokerPinB",
label: "Encoder Pin B",
description: "GPIO Pin Value (1-39) For encoder port B"
description: "GPIO Pin Value (1-39) For encoder port B",
},
{
type: "number",
name: "inputbrokerPinPress",
label: "Encoder Pin Press",
description: "GPIO Pin Value (1-39) For encoder Press"
description: "GPIO Pin Value (1-39) For encoder Press",
},
{
type: "select",
@@ -57,8 +57,8 @@ export const CannedMessage = (): JSX.Element => {
description: "Select input event.",
properties: {
enumValue:
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar
}
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
},
},
{
type: "select",
@@ -67,8 +67,8 @@ export const CannedMessage = (): JSX.Element => {
description: "Select input event.",
properties: {
enumValue:
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar
}
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
},
},
{
type: "select",
@@ -77,30 +77,30 @@ export const CannedMessage = (): JSX.Element => {
description: "Select input event",
properties: {
enumValue:
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar
}
Protobuf.ModuleConfig_CannedMessageConfig_InputEventChar,
},
},
{
type: "toggle",
name: "updown1Enabled",
label: "Up Down enabled",
description: "Enable the up / down encoder"
description: "Enable the up / down encoder",
},
{
type: "text",
name: "allowInputSource",
label: "Allow Input Source",
description:
"Select from: '_any', 'rotEnc1', 'upDownEnc1', 'cardkb'"
"Select from: '_any', 'rotEnc1', 'upDownEnc1', 'cardkb'",
},
{
type: "toggle",
name: "sendBell",
label: "Send Bell",
description: "Sends a bell character with each message"
}
]
}
description: "Sends a bell character with each message",
},
],
},
]}
/>
);
@@ -11,9 +11,9 @@ export const ExternalNotification = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "externalNotification",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const ExternalNotification = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Module Enabled",
description: "Enable External Notification"
description: "Enable External Notification",
},
{
type: "number",
@@ -40,12 +40,12 @@ export const ExternalNotification = (): JSX.Element => {
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
suffix: "ms"
}
suffix: "ms",
},
},
{
type: "number",
@@ -54,9 +54,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Output",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -65,9 +65,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Output Vibrate",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -76,9 +76,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Output Buzzer",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -87,9 +87,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Active",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -98,9 +98,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Alert Message",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -109,9 +109,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Alert Message Vibrate",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -120,9 +120,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Alert Message Buzzer",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -132,9 +132,9 @@ export const ExternalNotification = (): JSX.Element => {
"Should an alert be triggered when receiving an incoming bell?",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -143,9 +143,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Alert Bell Vibrate",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -154,9 +154,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Alert Bell Buzzer",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -165,9 +165,9 @@ export const ExternalNotification = (): JSX.Element => {
description: "Use PWM",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -176,12 +176,12 @@ export const ExternalNotification = (): JSX.Element => {
description: "Nag Timeout",
disabledBy: [
{
fieldName: "enabled"
}
]
}
]
}
fieldName: "enabled",
},
],
},
],
},
]}
/>
);
@@ -1,7 +1,7 @@
import type { MQTTValidation } from "@app/validation/moduleConfig/mqtt.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@app/core/stores/deviceStore.js";
import type { MQTTValidation } from "@app/validation/moduleConfig/mqtt.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
export const MQTT = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -11,9 +11,9 @@ export const MQTT = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "mqtt",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const MQTT = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Enabled",
description: "Enable or disable MQTT"
description: "Enable or disable MQTT",
},
{
type: "text",
@@ -40,9 +40,9 @@ export const MQTT = (): JSX.Element => {
"MQTT server address to use for default/custom servers",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "text",
@@ -51,9 +51,9 @@ export const MQTT = (): JSX.Element => {
description: "MQTT username to use for default/custom servers",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "password",
@@ -62,9 +62,9 @@ export const MQTT = (): JSX.Element => {
description: "MQTT password to use for default/custom servers",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -73,9 +73,9 @@ export const MQTT = (): JSX.Element => {
description: "Enable or disable MQTT encryption",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -84,12 +84,46 @@ export const MQTT = (): JSX.Element => {
description: "Whether to send/consume JSON packets on MQTT",
disabledBy: [
{
fieldName: "enabled"
}
]
}
]
}
fieldName: "enabled",
},
],
},
{
type: "toggle",
name: "tlsEnabled",
label: "TLS Enabled",
description: "Enable or disable TLS",
disabledBy: [
{
fieldName: "enabled",
},
],
},
{
type: "text",
name: "root",
label: "Root topic",
description: "MQTT root topic to use for default/custom servers",
disabledBy: [
{
fieldName: "enabled",
},
],
},
{
type: "toggle",
name: "proxyToClientEnabled",
label: "Proxy to Client Enabled",
description:
"Whether to proxy MQTT packets to the client (for example to Home Assistant)",
disabledBy: [
{
fieldName: "enabled",
},
],
},
],
},
]}
/>
);
@@ -11,9 +11,9 @@ export const RangeTest = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "rangeTest",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const RangeTest = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Module Enabled",
description: "Enable Range Test"
description: "Enable Range Test",
},
{
type: "number",
@@ -39,9 +39,9 @@ export const RangeTest = (): JSX.Element => {
description: "How long to wait between sending test packets",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "toggle",
@@ -50,12 +50,12 @@ export const RangeTest = (): JSX.Element => {
description: "ESP32 Only",
disabledBy: [
{
fieldName: "enabled"
}
]
}
]
}
fieldName: "enabled",
},
],
},
],
},
]}
/>
);
@@ -1,7 +1,7 @@
import type { SerialValidation } from "@app/validation/moduleConfig/serial.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Serial = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Serial = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "serial",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const Serial = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Module Enabled",
description: "Enable Serial output"
description: "Enable Serial output",
},
{
type: "toggle",
@@ -40,9 +40,9 @@ export const Serial = (): JSX.Element => {
"Any packets you send will be echoed back to your device",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -51,9 +51,9 @@ export const Serial = (): JSX.Element => {
description: "Set the GPIO pin to the RXD pin you have set up.",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -62,9 +62,9 @@ export const Serial = (): JSX.Element => {
description: "Set the GPIO pin to the TXD pin you have set up.",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "select",
@@ -74,12 +74,12 @@ export const Serial = (): JSX.Element => {
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
enumValue: Protobuf.ModuleConfig_SerialConfig_Serial_Baud
}
enumValue: Protobuf.ModuleConfig_SerialConfig_Serial_Baud,
},
},
{
type: "number",
@@ -90,12 +90,12 @@ export const Serial = (): JSX.Element => {
"Seconds to wait before we consider your packet as 'done'",
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
suffix: "Seconds"
}
suffix: "Seconds",
},
},
{
type: "select",
@@ -105,16 +105,23 @@ export const Serial = (): JSX.Element => {
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
enumValue: Protobuf.ModuleConfig_SerialConfig_Serial_Mode,
formatEnumName: true
}
}
]
}
formatEnumName: true,
},
},
{
type: "toggle",
name: "overrideConsoleSerialPort",
label: "Override Console Serial Port",
description:
"If you have a serial port connected to the console, this will override it.",
},
],
},
]}
/>
);
@@ -11,9 +11,9 @@ export const StoreForward = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "storeForward",
value: data
}
})
value: data,
},
}),
);
};
@@ -30,7 +30,7 @@ export const StoreForward = (): JSX.Element => {
type: "toggle",
name: "enabled",
label: "Module Enabled",
description: "Enable Store & Forward"
description: "Enable Store & Forward",
},
{
type: "toggle",
@@ -39,9 +39,9 @@ export const StoreForward = (): JSX.Element => {
description: "Enable Store & Forward heartbeat",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -51,12 +51,12 @@ export const StoreForward = (): JSX.Element => {
disabledBy: [
{
fieldName: "enabled"
}
fieldName: "enabled",
},
],
properties: {
suffix: "Records"
}
suffix: "Records",
},
},
{
type: "number",
@@ -65,9 +65,9 @@ export const StoreForward = (): JSX.Element => {
description: "Max number of records to return",
disabledBy: [
{
fieldName: "enabled"
}
]
fieldName: "enabled",
},
],
},
{
type: "number",
@@ -76,12 +76,12 @@ export const StoreForward = (): JSX.Element => {
description: "Max number of records to return",
disabledBy: [
{
fieldName: "enabled"
}
]
}
]
}
fieldName: "enabled",
},
],
},
],
},
]}
/>
);
@@ -1,7 +1,7 @@
import type { TelemetryValidation } from "@app/validation/moduleConfig/telemetry.js";
import { DynamicForm } from "@components/Form/DynamicForm.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/meshtasticjs";
import { DynamicForm } from "@components/Form/DynamicForm.js";
export const Telemetry = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
@@ -11,9 +11,9 @@ export const Telemetry = (): JSX.Element => {
new Protobuf.ModuleConfig({
payloadVariant: {
case: "telemetry",
value: data
}
})
value: data,
},
}),
);
};
@@ -32,8 +32,8 @@ export const Telemetry = (): JSX.Element => {
label: "Query Interval",
description: "Interval to get telemetry data",
properties: {
suffix: "seconds"
}
suffix: "seconds",
},
},
{
type: "number",
@@ -41,29 +41,41 @@ export const Telemetry = (): JSX.Element => {
label: "Update Interval",
description: "How often to send Metrics over the mesh",
properties: {
suffix: "seconds"
}
suffix: "seconds",
},
},
{
type: "toggle",
name: "environmentMeasurementEnabled",
label: "Module Enabled",
description: "Enable the Environment Telemetry"
description: "Enable the Environment Telemetry",
},
{
type: "toggle",
name: "environmentScreenEnabled",
label: "Displayed on Screen",
description: "Show the Telemetry Module on the OLED"
description: "Show the Telemetry Module on the OLED",
},
{
type: "toggle",
name: "environmentDisplayFahrenheit",
label: "Display Fahrenheit",
description: "Display temp in Fahrenheit"
}
]
}
description: "Display temp in Fahrenheit",
},
{
type: "toggle",
name: "airQualityEnabled",
label: "Air Quality Enabled",
description: "Enable the Air Quality Telemetry",
},
{
type: "number",
name: "airQualityInterval",
label: "Air Quality Update Interval",
description: "How often to send Air Quality data over the mesh",
},
],
},
]}
/>
);