2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

98_powerMap: improve number extraction

git-svn-id: https://svn.fhem.de/fhem/trunk@13931 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2017-04-08 11:42:26 +00:00
parent 566fef4942
commit a5fb12ab80

View File

@ -816,6 +816,8 @@ sub powerMap_Notify($$) {
# recalculate CHANGEDWITHSTATE
# for target device in deviceEvents()
$dev_hash->{CHANGEDWITHSTATE} = [];
last;
}
}
}
@ -1346,8 +1348,7 @@ sub powerMap_power($$$;$) {
if ( $event =~ /^([A-Za-z\d_\.\-\/]+):\s+(.*)$/ ) {
my ( $reading, $val ) = ( $1, $2 );
my $num = $val;
$num =~ s/[^-\.\d]//g;
my $num = ( $val =~ /(-?\d+(\.\d+)?)/ ? $1 : $val );
my $valueAliases = {
initialized => '0',