2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

50_HP1000: change time format for Internal SYSTEMTIME_UTC

git-svn-id: https://svn.fhem.de/fhem/trunk@24587 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2021-06-05 03:06:35 +00:00
parent b71bc0029e
commit 7b7164ec0a
2 changed files with 27 additions and 21 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix: 50_HP1000: change time format for Internal SYSTEMTIME_UTC
- bugfix: 73_AutoShuttersControl: add multiple Condition - bugfix: 73_AutoShuttersControl: add multiple Condition
for fixing shutter drives for fixing shutter drives
- bugfix: 89_AndroidDBHost: Fixed module not loaded error - bugfix: 89_AndroidDBHost: Fixed module not loaded error

View File

@ -413,6 +413,8 @@ sub HP1000_CGI() {
my $webArgs; my $webArgs;
my $servertype; my $servertype;
Log3 $name, 5, "HP1000 $name: called function HP1000_CGI()";
#TODO: should better be blocked in FHEMWEB already #TODO: should better be blocked in FHEMWEB already
return ( "text/plain; charset=utf-8", "Booting up" ) return ( "text/plain; charset=utf-8", "Booting up" )
unless ($init_done); unless ($init_done);
@ -466,7 +468,6 @@ sub HP1000_CGI() {
} }
if ( !defined( $webArgs->{softwaretype} ) if ( !defined( $webArgs->{softwaretype} )
|| !defined( $webArgs->{dateutc} )
|| !defined( $webArgs->{action} ) ) || !defined( $webArgs->{action} ) )
{ {
Log3 $name, 5, Log3 $name, 5,
@ -514,18 +515,21 @@ sub HP1000_CGI() {
HP1000_SetAliveState( $hash, 1 ); HP1000_SetAliveState( $hash, 1 );
$hash->{IP} = $defs{$FW_cname}{PEER}; $hash->{IP} = $defs{$FW_cname}{PEER};
$hash->{SERVER_TYPE} = $servertype; $hash->{SERVER_TYPE} = $servertype;
$hash->{SWVERSION} = $webArgs->{softwaretype}; $hash->{SWVERSION} = $webArgs->{softwaretype};
$hash->{INTERVAL} = (
$hash->{SYSTEMTIME_UTC} $hash->{INTERVAL} = (
? time_str2num( $webArgs->{dateutc} ) - $hash->{helper}->{SYSTEMTIME_UTC}
time_str2num( $hash->{SYSTEMTIME_UTC} ) ? strftime('%s',gmtime()) -
: 0 $hash->{helper}->{SYSTEMTIME_UTC}
); : 0
$hash->{SYSTEMTIME_UTC} = $webArgs->{dateutc}; );
$hash->{UPLOAD_TYPE} = "default"; $hash->{SYSTEMTIME_UTC} = gmtime();
$hash->{UPLOAD_TYPE} = "customize" $hash->{helper}->{SYSTEMTIME_UTC} = strftime('%s',gmtime());
$hash->{UPLOAD_TYPE} = "default";
$hash->{UPLOAD_TYPE} = "customize"
if ( defined( $webArgs->{solarradiation} ) ); if ( defined( $webArgs->{solarradiation} ) );
Log3 $name, 5, Log3 $name, 5,
@ -588,16 +592,17 @@ sub HP1000_CGI() {
# Filter values that seem bogus # Filter values that seem bogus
if ( AttrVal( $name, 'bogusFilter', 0 ) ne '0' ) { if ( AttrVal( $name, 'bogusFilter', 0 ) ne '0' ) {
foreach ($webArgs) { Log3 $name, 5,
next unless ( looks_like_number( $webArgs->{$_} ) ); "HP1000: Check data for bogus values";
foreach my $element (keys %{$webArgs}) {
if ( $webArgs->{$_} < -273.2 ) { next unless ( looks_like_number( $webArgs->{$element} ) );
if ( $webArgs->{$element} < -273.2 ) {
Log3 $name, 4, Log3 $name, 4,
"HP1000: " "HP1000: "
. "Received value '" . "Received value '"
. $webArgs->{$_} . $webArgs->{$element}
. "' for '$_' seems out of range - removed from data set"; . "' for '$element' seems out of range - removed from data set";
delete $webArgs->{$_}; delete $webArgs->{$element};
} }
} }
} }