* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-17.sme

- Fix return from function in Nutups-custom [SME: 13042]
- Check Seconds left for zero before dividing by 60
This commit is contained in:
Brian Read 2025-06-13 11:46:19 +01:00
parent f58cc8a22f
commit 32cfcf5ed3
3 changed files with 19 additions and 5 deletions

View File

@ -117,7 +117,7 @@ our $cdb;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
return %ret;
}
sub get_selected_CONFIG {
@ -125,7 +125,7 @@ our $cdb;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
return %ret;
}

View File

@ -16,7 +16,17 @@
<h2>Battery Status</h2>
<table>
<tr><td>Charge:</td><td><%= $nut_data->{'ups_data'}->{'battery.charge'} %>%</td></tr>
<tr><td>Runtime:</td><td><%= sprintf("%.2f", $nut_data->{'ups_data'}->{'battery.runtime'} / 60) %> minutes</td></tr>
%#<tr><td>Runtime:</td><td><%= sprintf("%.2f", $nut_data->{'ups_data'}->{'battery.runtime'} / 60) %> minutes</td></tr>
<td>Runtime:</td>
<td>
<%
my $runtime = $nut_data->{'ups_data'}->{'battery.runtime'};
my $runtime_minutes = (defined $runtime && $runtime =~ /^\d+(\.\d+)?$/)
? sprintf("%.2f", $runtime / 60)
: 'N/A';
%>
<%= $runtime_minutes %> minutes
</td>
<tr><td>Voltage:</td><td><%= $nut_data->{'ups_data'}->{'battery.voltage'} %>V</td></tr>
<tr><td>Type:</td><td><%= $nut_data->{'ups_data'}->{'battery.type'} %></td></tr>
</table>

View File

@ -4,7 +4,7 @@ Summary: SME server - nut UPS interaction module
%define name smeserver-nutUPS
Name: %{name}
%define version 11.0.0
%define release 16
%define release 17
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@ -26,6 +26,10 @@ A module which configures the Network UPS Tools suite for operation with
the SME server software.
%changelog
* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-17.sme
- Fix return from function in Nutups-custom [SME: 13042]
- Check Seconds left for zero before dividing by 60
* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-16.sme
- Change Navigation weighting for SM2 [SME: 12996]