Add client notification (#771)
* ClientNotification WIP * Test * ClientNotification WIP * Add client notification dialog and related functionality * Update ClientNotificationDialog.tsx --------- Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
co-authored by
philon-
parent
176d554ef9
commit
32f31cb502
@@ -330,6 +330,15 @@ export class EventSystem {
|
||||
PacketMetadata<Uint8Array>
|
||||
> = new SimpleEventDispatcher<PacketMetadata<Uint8Array>>();
|
||||
|
||||
/**
|
||||
* Fires when a new MeshPacket message containing a ClientNotification packet has been
|
||||
* received from device
|
||||
*
|
||||
* @event onClientNotificationPacket
|
||||
*/
|
||||
public readonly onClientNotificationPacket: SimpleEventDispatcher<Protobuf.Mesh.ClientNotification> =
|
||||
new SimpleEventDispatcher<Protobuf.Mesh.ClientNotification>();
|
||||
|
||||
/**
|
||||
* Fires when the devices connection or configuration status changes
|
||||
*
|
||||
|
||||
@@ -209,6 +209,18 @@ export const decodePacket = (device: MeshDevice) =>
|
||||
break;
|
||||
}
|
||||
|
||||
case "clientNotification": {
|
||||
device.log.trace(
|
||||
Types.Emitter[Types.Emitter.HandleFromRadio],
|
||||
`📣 Received ClientNotification: ${decodedMessage.payloadVariant.value.message}`,
|
||||
);
|
||||
|
||||
device.events.onClientNotificationPacket.dispatch(
|
||||
decodedMessage.payloadVariant.value,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
device.log.warn(
|
||||
Types.Emitter[Types.Emitter.HandleFromRadio],
|
||||
|
||||
Reference in New Issue
Block a user