mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fhem.pl: add readingsBulkUpdateIfChanged (Forum #58797)
git-svn-id: https://svn.fhem.de/fhem/trunk@12311 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fec33610f1
commit
0ffeb8ae51
12
fhem/fhem.pl
12
fhem/fhem.pl
@ -4044,9 +4044,19 @@ readingsEndUpdate($$)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
sub
|
||||||
|
readingsBulkUpdateIfChanged($$$@) # Forum #58797
|
||||||
|
{
|
||||||
|
my ($hash,$reading,$value,$changed)= @_;
|
||||||
|
return undef if($value eq ReadingsVal($hash->{NAME},$reading,""));
|
||||||
|
return readingsBulkUpdate($hash,$reading,$value,$changed);
|
||||||
|
}
|
||||||
|
|
||||||
# Call readingsBulkUpdate to update the reading.
|
# Call readingsBulkUpdate to update the reading.
|
||||||
# Example: readingsUpdate($hash,"temperature",$value);
|
# Example: readingsUpdate($hash,"temperature",$value);
|
||||||
|
# Optional parameter $changed: if defined, and is 0, do not trigger events. If
|
||||||
|
# 1, trigger. If not defined, the name of the reading decides (starting with .
|
||||||
|
# is 0, else 1). The event-on-* filtering is done additionally.
|
||||||
#
|
#
|
||||||
sub
|
sub
|
||||||
readingsBulkUpdate($$$@)
|
readingsBulkUpdate($$$@)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user