mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +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.
|
# 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.
|
||||||
|
- feature: 30_pilight_contact: add battery reading if information is available
|
||||||
- update: 88_HMCCU: Homematic firmware download, advanced scripting
|
- update: 88_HMCCU: Homematic firmware download, advanced scripting
|
||||||
- feature: 98_TRAFFIC: v1.3.2, stroke styles, warnings reduced, bugfix
|
- feature: 98_TRAFFIC: v1.3.2, stroke styles, warnings reduced, bugfix
|
||||||
- update: 98_DOIFtools: more precise regexp for INITIALIZED event because
|
- update: 98_DOIFtools: more precise regexp for INITIALIZED event because
|
||||||
|
@ -896,7 +896,13 @@ sub pilight_ctrl_Parse($$)
|
|||||||
Log3 $me, 4, "$me(Dispatch): $msg";
|
Log3 $me, 4, "$me(Dispatch): $msg";
|
||||||
return Dispatch($hash, $msg ,undef);
|
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 {
|
case 4 {
|
||||||
my $piTempData = "";
|
my $piTempData = "";
|
||||||
$piTempData .= ",temperature:$data->{$s}{temperature}" if (defined($data->{$s}{temperature}));
|
$piTempData .= ",temperature:$data->{$s}{temperature}" if (defined($data->{$s}{temperature}));
|
||||||
|
@ -81,9 +81,7 @@ sub pilight_contact_Parse($$)
|
|||||||
my $backend = $mhash->{NAME};
|
my $backend = $mhash->{NAME};
|
||||||
|
|
||||||
Log3 $backend, 4, "pilight_contact_Parse ($backend): RCV -> $rmsg";
|
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);
|
my ($dev,$protocol,$id,$unit,$state,@args) = split(",",$rmsg);
|
||||||
return () if($dev ne "PICONTACT");
|
return () if($dev ne "PICONTACT");
|
||||||
|
|
||||||
@ -101,8 +99,14 @@ sub pilight_contact_Parse($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return () if (!defined($chash->{NAME}));
|
return () if (!defined($chash->{NAME}));
|
||||||
|
|
||||||
readingsBeginUpdate($chash);
|
readingsBeginUpdate($chash);
|
||||||
|
|
||||||
|
foreach my $arg (@args){
|
||||||
|
my($feature,$value) = split(":",$arg);
|
||||||
|
readingsBulkUpdate($chash,$feature,$value);
|
||||||
|
}
|
||||||
|
|
||||||
readingsBulkUpdate($chash,"state",$state);
|
readingsBulkUpdate($chash,"state",$state);
|
||||||
readingsEndUpdate($chash, 1);
|
readingsEndUpdate($chash, 1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user