MAX: Fix PushButtonState bits parsing

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2792 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2013-02-23 18:31:47 +00:00
parent 8bde3491e2
commit 6e509ba68f
2 changed files with 4 additions and 8 deletions

View File

@ -664,13 +664,14 @@ MAX_Parse($$)
readingsBulkUpdate($shash,"onoff",$isopen); readingsBulkUpdate($shash,"onoff",$isopen);
}elsif($msgtype eq "PushButtonState") { }elsif($msgtype eq "PushButtonState") {
my ($bits2, $onoff) = unpack("CC",pack("H*",$args[0])); my ($bits2, $onoff) = unpack("aC",pack("H*",$args[0]));
#The meaning of $bits2 is completly guessed based on similarity to other devices, TODO: confirm #The meaning of $bits2 is completly guessed based on similarity to other devices, TODO: confirm
my $rferror = vec($bits2, 6, 1); #communication with link partner (what does that mean?) my $gateway = vec($bits2, 4, 1); #Paired to a CUBE?
my $rferror = vec($bits2, 6, 1); #communication with link partner (1 if we did not sent an Ack)
my $batterylow = vec($bits2, 7, 1); #1 if battery is low my $batterylow = vec($bits2, 7, 1); #1 if battery is low
readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok"); readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok");
readingsBulkUpdate($shash,"onoff",$onoff); readingsBulkUpdate($shash, "onoff", $onoff);
}elsif($msgtype eq "CubeClockState"){ }elsif($msgtype eq "CubeClockState"){
my $clockset = $args[0]; my $clockset = $args[0];

View File

@ -1,13 +1,8 @@
package MaxCommon; package MaxCommon;
#use vars qw(%device_types);
#use vars qw(%msgId2Cmd);
#use vars qw(%msgCmd2Id);
require Exporter; require Exporter;
@ISA = qw(Exporter); @ISA = qw(Exporter);
@EXPORT = qw(%device_types %msgId2Cmd %msgCmd2Id $defaultWeekProfile); @EXPORT = qw(%device_types %msgId2Cmd %msgCmd2Id $defaultWeekProfile);
#@EXPORT_OK = qw($Zeitstempel @Logdaten Besteller_ermitteln);
%device_types = ( %device_types = (
0 => "Cube", 0 => "Cube",