Browse Source

premerge

pull/296/head
Hunter Thornsberry 2 years ago
parent
commit
42122c99ac
  1. 2
      package.json
  2. 177
      pnpm-lock.yaml
  3. 14
      src/components/PageComponents/ModuleConfig/CannedMessage.tsx
  4. 11
      src/core/stores/deviceStore.ts
  5. 5
      src/validation/moduleConfig/cannedMessage.ts

2
package.json

@ -23,7 +23,7 @@
"dependencies": {
"@bufbuild/protobuf": "^1.10.0",
"@emeraldpay/hashicon-react": "^0.5.2",
"@meshtastic/js": "2.3.7-0",
"@meshtastic/js": "2.3.7-3",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-checkbox": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",

177
pnpm-lock.yaml

@ -15,8 +15,8 @@ importers:
specifier: ^0.5.2
version: 0.5.2
'@meshtastic/js':
specifier: 2.3.7-0
version: 2.3.7-0
specifier: 2.3.7-3
version: 2.3.7-3
'@radix-ui/react-accordion':
specifier: ^1.2.0
version: 1.2.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
@ -581,8 +581,8 @@ packages:
resolution: {integrity: sha512-eSiQ3E5LUSxAOY9ABXGyfNhout2iEa6mUxKeaQ9nJ8NL1NuaQYU7zKqzx/LEYcXe1neT4uYAgM1wYZj3fTSXtA==}
hasBin: true
'@meshtastic/[email protected]0':
resolution: {integrity: sha512-XTNyUXj3SWQ91XqwgrTZT7rTQsiI3d8noRaxnpxRw6Ck7WtjjPF0ygnPA8eQ6kastyUkgpXzcjtD9a6Qz6n+WQ==}
'@meshtastic/[email protected]3':
resolution: {integrity: sha512-ezdloSREVd9DytZ8sSBmEVsG4Xp6I91yAPnT51OjOC9n/3ZQjyjCUwesys/fTC6077JQO3+ton1IO9HuMLPNiA==}
'@nodelib/[email protected]':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
@ -1306,6 +1306,70 @@ packages:
cpu: [x64]
os: [win32]
'@serialport/[email protected]':
resolution: {integrity: sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-r2XOwY2dDvbW7dKqSPIk2gzsr6M6Qpe9+/Ngs94fNaNlcTRCV02PfaoDmRgcubpNVVcLATlxSxPTIDw12dbKOg==}
engines: {node: '>=16.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-CJaUd5bLvtM9c5dmO9rPBHPXTa9R2UwpkJ0wdh9JCYcbrPWsKz+ErvR0hBLeo7NPeiFdjFO4sonRljiw4d2XiA==}
engines: {node: ^12.22 || ^14.13 || >=16}
'@serialport/[email protected]':
resolution: {integrity: sha512-0ei0txFAj+s6FTiCJFBJ1T2hpKkX8Md0Pu6dqMrYoirjPskDLJRgZGLqoy3/lnU1bkvHpnJO+9oJ3PB9v8rNlg==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-0PfLzO9t2X5ufKuBO34DQKLXrCCqS9xz2D0pfuaLNeTkyGUBv426zxoMf3rsMRodDOZNbFblu3Ae84MOQXjnZw==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-aZLJhlRTjSmEwllLG7S4J8s8ctRAS0cbvCpO87smLvl3e4BgzbVgF6Z6zaJd3Aji2uSiYgfedCdNc4L6W+1E2g==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-gu26tVt5lQoybhorLTPsH2j2LnX3AOP2x/34+DUSTNaUTzu2fBXw+isVjQJpUBFWu6aeQRZw5bJol5X9Gxjblw==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-GnCh8K0NAESfhCuXAt+FfBRz1Cf9CzIgXfp7SdMgXwrtuUnCC/yuRTUFWRvuzhYKoAo1TL0hhUo77SFHUH1T/w==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-p1hiCRqvGHHLCN/8ZiPUY/G0zrxd7gtZs251n+cfNTn+87rwcdUeu9Dps3Aadx30/sOGGFL6brIRGK4l/t7MuQ==}
engines: {node: '>=8.6.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-rRAivhRkT3YO28WjmmG4FQX6L+KMb5/ikhyylRfzWPw0nSXy97+u07peS9CbHqaNvJkMhH1locp2H36aGMOEIA==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-O7cywCWC8PiOMvo/gglEBfAkLjp/SENEML46BXDykfKP5mTPM46XMaX1L0waWU6DXJpBgjaL7+yX6VriVPbN4w==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-ygDwj3O4SDpZlbrRUraoXIoIqb8sM7aMKryGjYTIF0JRnKeB1ys8+wIp0RFMdFbO62YriUDextHB5Um5cKFSWg==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-dCAVh4P/pZrLcPv9NJ2mvPRBg64L5jXuiRxIlyxxdZGH4WubwXVXY/kBTihQmiAMPxbT3yshSX8f2+feqWsxqA==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-0APxDGR9YvJXTRfY+uRGhzOhTpU5akSH183RUcwzN7QXh8/1jwFsFLCu0grmAUfi+fItCkR+Xr1TcNJLR13VNA==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-dozONxhPC/78pntuxpz/NOtVps8qIc/UZzdc/LuPvVsqCoJXiRxOg6ZtCP/W58iibJDKPZPAWPGYeZt9DJxI+Q==}
engines: {node: '>=12.0.0'}
'@serialport/[email protected]':
resolution: {integrity: sha512-9On64rhzuqKdOQyiYLYv2lQOh3TZU/D3+IWCR5gk0alPel2nwpp4YwDEGiUBfrQZEdQ6xww0PWkzqth4wqwX3Q==}
engines: {node: '>=12.0.0'}
'@stablelib/[email protected]':
resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==}
@ -1925,6 +1989,15 @@ packages:
[email protected]:
resolution: {integrity: sha512-RhGS1u2vavcO7ay7ZNAPo4xeDh/VYeGof3x5ZLJBQgYhLegxr3s5IykvWmJ94FTU6mcbtp4sloqZ54mP6R4Utw==}
[email protected]:
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
[email protected]:
resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==}
engines: {node: '>=6.0'}
@ -2415,6 +2488,13 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
[email protected]:
resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==}
[email protected]:
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
hasBin: true
[email protected]:
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
@ -2748,6 +2828,10 @@ packages:
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
hasBin: true
[email protected]:
resolution: {integrity: sha512-AmH3D9hHPFmnF/oq/rvigfiAouAKyK/TjnrkwZRYSFZxNggJxwvbAbfYrLeuvq7ktUdhuHdVdSjj852Z55R+uA==}
engines: {node: '>=16.0.0'}
[email protected]:
resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
engines: {node: '>= 0.4'}
@ -3477,13 +3561,15 @@ snapshots:
sort-object: 3.0.3
tinyqueue: 2.0.3
'@meshtastic/[email protected]0':
'@meshtastic/[email protected]3':
dependencies:
crc: 4.3.2
serialport: 12.0.0
ste-simple-events: 3.0.11
tslog: 4.9.3
transitivePeerDependencies:
- buffer
- supports-color
'@nodelib/[email protected]':
dependencies:
@ -4195,6 +4281,60 @@ snapshots:
'@rollup/[email protected]':
optional: true
'@serialport/[email protected]':
dependencies:
'@serialport/bindings-interface': 1.2.2
debug: 4.3.5
transitivePeerDependencies:
- supports-color
'@serialport/[email protected]':
dependencies:
'@serialport/bindings-interface': 1.2.2
'@serialport/parser-readline': 11.0.0
debug: 4.3.4
node-addon-api: 7.0.0
node-gyp-build: 4.6.0
transitivePeerDependencies:
- supports-color
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]':
dependencies:
'@serialport/parser-delimiter': 11.0.0
'@serialport/[email protected]':
dependencies:
'@serialport/parser-delimiter': 12.0.0
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]': {}
'@serialport/[email protected]':
dependencies:
'@serialport/bindings-interface': 1.2.2
debug: 4.3.4
transitivePeerDependencies:
- supports-color
'@stablelib/[email protected]':
dependencies:
'@stablelib/int': 1.0.1
@ -5320,6 +5460,10 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
ms: 2.1.2
[email protected]:
dependencies:
ms: 2.1.2
@ -5823,6 +5967,10 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
@ -6153,6 +6301,25 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
'@serialport/binding-mock': 10.2.2
'@serialport/bindings-cpp': 12.0.1
'@serialport/parser-byte-length': 12.0.0
'@serialport/parser-cctalk': 12.0.0
'@serialport/parser-delimiter': 12.0.0
'@serialport/parser-inter-byte-timeout': 12.0.0
'@serialport/parser-packet-length': 12.0.0
'@serialport/parser-readline': 12.0.0
'@serialport/parser-ready': 12.0.0
'@serialport/parser-regex': 12.0.0
'@serialport/parser-slip-encoder': 12.0.0
'@serialport/parser-spacepacket': 12.0.0
'@serialport/stream': 12.0.0
debug: 4.3.4
transitivePeerDependencies:
- supports-color
[email protected]:
dependencies:
define-data-property: 1.1.4

14
src/components/PageComponents/ModuleConfig/CannedMessage.tsx

@ -4,7 +4,7 @@ import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/js";
export const CannedMessage = (): JSX.Element => {
const { moduleConfig, setWorkingModuleConfig } = useDevice();
const { moduleConfig, setWorkingModuleConfig, setCannedMessages } = useDevice();
const onSubmit = (data: CannedMessageValidation) => {
setWorkingModuleConfig(
@ -15,6 +15,12 @@ export const CannedMessage = (): JSX.Element => {
},
}),
);
setCannedMessages(
new Protobuf.CannedMessages.CannedMessageModuleConfig({
messages: data.messages
})
)
};
return (
@ -32,6 +38,12 @@ export const CannedMessage = (): JSX.Element => {
label: "Module Enabled",
description: "Enable Canned Message",
},
{
type: "text",
name: "messages",
label: "Messages",
description: "Separate messages with |",
},
{
type: "toggle",
name: "rotary1Enabled",

11
src/core/stores/deviceStore.ts

@ -69,6 +69,7 @@ export interface Device {
setWorkingModuleConfig: (config: Protobuf.ModuleConfig.ModuleConfig) => void;
setHardware: (hardware: Protobuf.Mesh.MyNodeInfo) => void;
// setMetrics: (metrics: Types.PacketMetadata<Protobuf.Telemetry>) => void;
setCannedMessages: (message: Protobuf.CannedMessages.CannedMessageModuleConfig) => void;
setActivePage: (page: Page) => void;
setActiveNode: (node: number) => void;
setPendingSettingsChanges: (state: boolean) => void;
@ -361,6 +362,16 @@ export const useDeviceStore = create<DeviceState>((set, get) => ({
// })
// );
// },
setCannedMessages: (messages) => {
set(
produce<DeviceState>((draft) => {
const device = draft.devices.get(id);
if (device) {
device.setCannedMessages(messages);
}
}),
);
},
setActivePage: (page) => {
set(
produce<DeviceState>((draft) => {

5
src/validation/moduleConfig/cannedMessage.ts

@ -1,6 +1,6 @@
import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
import { IsBoolean, IsEnum, IsInt, IsString, Length } from "class-validator";
export class CannedMessageValidation
implements
@ -38,4 +38,7 @@ export class CannedMessageValidation
@IsBoolean()
sendBell: boolean;
@IsString()
messages: string;
}

Loading…
Cancel
Save