mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +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:
parent
566fef4942
commit
a5fb12ab80
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user