Added reset flag

This commit is contained in:
Jurn Wubben 2025-08-05 15:19:34 +02:00
parent 29a98d83bb
commit b7c7a2e04c
2 changed files with 9 additions and 1 deletions

View file

@ -68,6 +68,7 @@ zone2="x=10,y=10,width=10,height=10" --message zone1="Hello {scrolloff}"
- `--display_repeat`: Not really sure. The default is 0.
- `--ttl`: The message will self-destruct in x seconds. Default is 0.
- `--sound_alarm`: If true, the sign will beep when the message is displayed.
- `--reset`: resets the device before sending the message.
### Message Formatting

View file

@ -17,6 +17,7 @@ my $display_delay;
my $display_repeat;
my $ttl;
my $sound_alarm;
my $reset; # New flag for resetting the sign
GetOptions(
"zone=s@" => \$zone_array_ref,
@ -27,7 +28,8 @@ GetOptions(
"display_delay=i" => \$display_delay,
"display_repeat=i" => \$display_repeat,
"ttl=i" => \$ttl,
"sound_alarm" => \$sound_alarm
"sound_alarm" => \$sound_alarm,
"reset" => \$reset # Add the reset flag
);
die "Error: --address parameter is required.\n" unless defined $address;
@ -65,6 +67,11 @@ foreach my $message_str (@{$message_array_ref}) {
}
my $sign = Net::Symon::NetBrite->new(address => $address);
if ($reset) { # If --reset is provided, reboot the sign
$sign->reboot();
}
$sign->zones(%zones);
my %message_params;