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
@@ -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",
},
},
],
},
]}
/>
);