Skip to content

Commit

Permalink
Updated device roles and modem presets
Browse files Browse the repository at this point in the history
  • Loading branch information
RCGV1 committed Jan 1, 2025
1 parent 5990278 commit 882d78e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 22 deletions.
26 changes: 19 additions & 7 deletions src/components/config/device/DeviceConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export const DeviceConfigPage = ({
>
<div className="flex flex-col gap-6">
<ConfigSelect
text={t("config.radio.device.deviceRole.title")}
{...register("role")}
text={t("config.radio.device.deviceRole.title")}
{...register("role")}
>
<option value="0">
{t("config.radio.device.deviceRole.client")}
Expand All @@ -111,9 +111,6 @@ export const DeviceConfigPage = ({
<option value="2">
{t("config.radio.device.deviceRole.router")}
</option>
<option value="3">
{t("config.radio.device.deviceRole.routerClient")}
</option>
<option value="4">
{t("config.radio.device.deviceRole.repeater")}
</option>
Expand All @@ -123,11 +120,26 @@ export const DeviceConfigPage = ({
<option value="6">
{t("config.radio.device.deviceRole.sensor")}
</option>
<option value="7">
{t("config.radio.device.deviceRole.tak")}
</option>
<option value="8">
{t("config.radio.device.deviceRole.clientHidden")}
</option>
<option value="9">
{t("config.radio.device.deviceRole.lostFound")}
</option>
<option value="10">
{t("config.radio.device.deviceRole.takTracker")}
</option>
<option value="11">
{t("config.radio.device.deviceRole.routerLate")}
</option>
</ConfigSelect>

<ConfigInput
type="checkbox"
text={t("config.radio.device.serialEnabled")}
type="checkbox"
text={t("config.radio.device.serialEnabled")}
error={errors.serialEnabled?.message as string}
{...register("serialEnabled")}
/>
Expand Down
25 changes: 14 additions & 11 deletions src/components/config/device/LoRaConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,37 +150,40 @@ export const LoRaConfigPage = ({ className = "" }: ILoRaConfigPageProps) => {
/>

<ConfigSelect
text={t("config.radio.lora.modemPreset.title")}
disabled={!useModemPreset}
{...register("modemPreset")}
text={t("config.radio.lora.modemPreset.title")}
disabled={!useModemPreset}
{...register("modemPreset")}
>
<option value="0">
{t("config.radio.lora.modemPreset.longFast")}
</option>
<option value="1">
{t("config.radio.lora.modemPreset.longSlow")}
</option>
<option value="2">
{t("config.radio.lora.modemPreset.veryLongSlow")}
</option>
<option value="3">
{t("config.radio.lora.modemPreset.medSlow")}
</option>
<option value="4">
{t("config.radio.lora.modemPreset.shortSlow")}
{t("config.radio.lora.modemPreset.medFast")}
</option>
<option value="5">
{t("config.radio.lora.modemPreset.shortFast")}
{t("config.radio.lora.modemPreset.shortSlow")}
</option>
<option value="6">
{t("config.radio.lora.modemPreset.shortFast")}
</option>
<option value="7">
{t("config.radio.lora.modemPreset.longModerate")}
</option>
<option value="8">
{t("config.radio.lora.modemPreset.shortTurbo")}
</option>
</ConfigSelect>

<ConfigInput
disabled={useModemPreset}
type="number"
text={t("config.radio.lora.bandwidth")}
disabled={useModemPreset}
type="number"
text={t("config.radio.lora.bandwidth")}
error={errors.bandwidth?.message as string}
{...register("bandwidth")}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/config/device/PowerConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const PowerConfigPage = ({ className = "" }: IPowerConfigPageProps) => {
>
<div className="flex flex-col gap-6">
<ConfigInput
type="checkbox"
type="switch"
text={t("config.radio.power.enablePowerSaving")}
error={errors.isPowerSaving?.message as string}
{...register("isPowerSaving")}
Expand Down
12 changes: 9 additions & 3 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@
"routerClient": "Router + Client",
"repeater": "Repeater",
"tracker": "Tracker",
"sensor": "Sensor"
"sensor": "Sensor",
"tak": "Tak",
"clientHidden": "Client (hidden)",
"lostFound": "Lost and Found",
"takTracker": "Tak Tracker",
"routerLate": "Router Late"
},
"serialEnabled": "Serial Enabled",
"serialDebugEnabled": "Serial Debug Enabled",
Expand Down Expand Up @@ -279,11 +284,12 @@
"title": "Modem Preset",
"longFast": "Long Fast",
"longSlow": "Long Slow",
"veryLongSlow": "Very Long Slow",
"medFast": "Medium Fast",
"medSlow": "Medium Slow",
"shortSlow": "Short Slow",
"shortFast": "Short Fast",
"longModerate": "Long Moderate"
"longModerate": "Long Moderate",
"shortTurbo": "Short Turbo"
},
"bandwidth": "Bandwidth (kHz)",
"spreadFactor": "Spread Factor (1 << spread_factor)",
Expand Down

0 comments on commit 882d78e

Please sign in to comment.