summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r--lib/DBInfoscreen.pm22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm
index 4445d7f..70b4b5e 100644
--- a/lib/DBInfoscreen.pm
+++ b/lib/DBInfoscreen.pm
@@ -295,6 +295,28 @@ sub startup {
);
$self->helper(
+ 'occupancy_icon' => sub {
+ my ( $self, $occupancy ) = @_;
+
+ my @symbols
+ = (qw(help_outline person_outline people priority_high));
+ my $text = 'Auslastung unbekannt';
+
+ if ( $occupancy > 2 ) {
+ $text = 'Sehr hohe Auslastung';
+ }
+ elsif ( $occupancy > 1 ) {
+ $text = 'Hohe Auslastung';
+ }
+ elsif ( $occupancy > 0 ) {
+ $text = 'Geringe Auslastung';
+ }
+
+ return ( $text, $symbols[$occupancy] );
+ }
+ );
+
+ $self->helper(
'utilization_icon' => sub {
my ( $self, $utilization ) = @_;
my ( $first, $second ) = @{ $utilization // [ 0, 0 ] };