protobufs icon indicating copy to clipboard operation
protobufs copied to clipboard

Flexible configuration for the external notification module

Open haxney opened this issue 1 year ago • 1 comments

With multiple different triggers and actions, the number of fields in the ExternalNotificationConfig was starting to grow large, and the interactions between the different fields was complicated.

Example

For example, if someone wanted the configuration

start the buzzer and vibra when receiving a direct message containing a bell character

then the ExternalNotificationConfig message would need a field:

bool alert_bell_direct_message_buzzer = 16;
bool alert_bell_direct_message_vibra = 17;

And so on for each combination of conditions and actions.

This commit

This commit introduces the ExternalNotificationCase message, which separates the condition (when to trigger an external notification) from the action (which pin to activate). The previous example would look like this:

case {
  condition {
    dest_direct: {}
    content_bell: {}
  }
  actions {
    output_buzzer: {}
  }
  actions {
    output_vibra: {}
  }
}

Adding new conditions (such as a message text containing a string prefix or being sent by a particular node) and actions (such as a fourth output pin) does not result in a combinatorial explosion of fields and keeps the implementation simpler.

haxney avatar Oct 25 '23 20:10 haxney

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Oct 25 '23 20:10 CLAassistant

CLA was never signed, closing before its first birthday.

caveman99 avatar Sep 22 '24 15:09 caveman99

Yeah, sorry. My work didn't let me sign the CLA, so it looks like I can't contribute to this project :frowning_face:.

haxney avatar Sep 23 '24 18:09 haxney

Sorry to hear @haxney . It would have been great to have you :) If there's anything we can do in the future, please don't hesitate to let us know.

fifieldt avatar Sep 24 '24 03:09 fifieldt