mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
MAX: Fix PushButtonState bits parsing
git-svn-id: https://svn.fhem.de/fhem/trunk@2792 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
93d4c1ba8d
commit
2da78a539f
@ -664,13 +664,14 @@ MAX_Parse($$)
|
||||
readingsBulkUpdate($shash,"onoff",$isopen);
|
||||
|
||||
}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
|
||||
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
|
||||
|
||||
readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok");
|
||||
readingsBulkUpdate($shash,"onoff",$onoff);
|
||||
readingsBulkUpdate($shash, "onoff", $onoff);
|
||||
|
||||
}elsif($msgtype eq "CubeClockState"){
|
||||
my $clockset = $args[0];
|
||||
|
@ -1,13 +1,8 @@
|
||||
package MaxCommon;
|
||||
|
||||
#use vars qw(%device_types);
|
||||
#use vars qw(%msgId2Cmd);
|
||||
#use vars qw(%msgCmd2Id);
|
||||
|
||||
require Exporter;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(%device_types %msgId2Cmd %msgCmd2Id $defaultWeekProfile);
|
||||
#@EXPORT_OK = qw($Zeitstempel @Logdaten Besteller_ermitteln);
|
||||
|
||||
%device_types = (
|
||||
0 => "Cube",
|
||||
|
Loading…
Reference in New Issue
Block a user