mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
30_pilight_contact: add battery reading if information is available
git-svn-id: https://svn.fhem.de/fhem/trunk@14105 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b382967ea1
commit
529a3dab04
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- feature: 30_pilight_contact: add battery reading if information is available
|
||||
- update: 88_HMCCU: Homematic firmware download, advanced scripting
|
||||
- feature: 98_TRAFFIC: v1.3.2, stroke styles, warnings reduced, bugfix
|
||||
- update: 98_DOIFtools: more precise regexp for INITIALIZED event because
|
||||
|
@ -896,7 +896,13 @@ sub pilight_ctrl_Parse($$)
|
||||
Log3 $me, 4, "$me(Dispatch): $msg";
|
||||
return Dispatch($hash, $msg ,undef);
|
||||
}
|
||||
case 3 { return Dispatch($hash, "PICONTACT,$proto,$id,$unit,$state",undef); }
|
||||
case 3 {
|
||||
my $piTempData = "";
|
||||
$piTempData .= ",battery:$data->{$s}{battery}" if (defined($data->{$s}{battery}));
|
||||
my $msg = "PICONTACT,$proto,$id,$unit,$state$piTempData";
|
||||
Log3 $me, 4, "$me(Dispatch): $msg";
|
||||
return Dispatch($hash, $msg,undef);
|
||||
}
|
||||
case 4 {
|
||||
my $piTempData = "";
|
||||
$piTempData .= ",temperature:$data->{$s}{temperature}" if (defined($data->{$s}{temperature}));
|
||||
|
@ -81,9 +81,7 @@ sub pilight_contact_Parse($$)
|
||||
my $backend = $mhash->{NAME};
|
||||
|
||||
Log3 $backend, 4, "pilight_contact_Parse ($backend): RCV -> $rmsg";
|
||||
|
||||
Log3 $backend, 4, "pilight_contact_Parse ($backend): RCV -> $rmsg";
|
||||
|
||||
|
||||
my ($dev,$protocol,$id,$unit,$state,@args) = split(",",$rmsg);
|
||||
return () if($dev ne "PICONTACT");
|
||||
|
||||
@ -101,8 +99,14 @@ sub pilight_contact_Parse($$)
|
||||
}
|
||||
|
||||
return () if (!defined($chash->{NAME}));
|
||||
|
||||
|
||||
readingsBeginUpdate($chash);
|
||||
|
||||
foreach my $arg (@args){
|
||||
my($feature,$value) = split(":",$arg);
|
||||
readingsBulkUpdate($chash,$feature,$value);
|
||||
}
|
||||
|
||||
readingsBulkUpdate($chash,"state",$state);
|
||||
readingsEndUpdate($chash, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user