MAX: various changes by J. Isleib

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4156 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2013-11-05 23:03:16 +00:00
parent eac51ecc63
commit 25a97e0b81

View File

@ -2,6 +2,8 @@
# $Id$
# Written by Matthias Gehre, M.Gehre@gmx.de, 2012-2013
#
# Dutycycle included by J. Isleib 2013-09-26
#
package main;
use v5.10.1;
@ -572,7 +574,7 @@ MAX_Parse($$)
my $devicetype = undef;
$devicetype = $args[0] if($msgtype eq "define");
$devicetype = "ShutterContact" if($msgtype eq "ShutterContactState");
$devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState");
$devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState" or $msgtype eq "CubeDutyCycleState");
$devicetype = "WallMountedThermostat" if(grep /^$msgtype$/, ("WallThermostatConfig","WallThermostatState","WallThermostatControl"));
$devicetype = "HeatingThermostat" if(grep /^$msgtype$/, ("HeatingThermostatConfig", "ThermostatState"));
if($devicetype) {
@ -643,12 +645,12 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "desiredTemperature", MAX_SerializeTemperature($desiredTemperature)) if($desiredTemperature != 0);
if($measuredTemperature ne "") {
readingsBulkUpdate($shash, "temperature", MAX_SerializeTemperature($measuredTemperature));
}
if($shash->{type} =~ /HeatingThermostatPlus/ and $hash->{TYPE} eq "MAXLAN") {
readingsBulkUpdate($shash, "valveposition", int($valveposition*MAX_ReadingsVal($shash,"maxValveSetting")/100));
} else {
readingsBulkUpdate($shash, "valveposition", $valveposition);
}
}
}elsif(grep /^$msgtype$/, ("WallThermostatState", "WallThermostatControl" )){
my ($bits2,$displayActualTemperature,$desiredTemperatureRaw,$null1,$heaterTemperature,$null2,$temperature);
@ -721,6 +723,7 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok");
readingsBulkUpdate($shash, "onoff", $onoff);
readingsBulkUpdate($shash, "connection", $gateway);
}elsif($msgtype eq "CubeClockState"){
my $clockset = $args[0];
@ -731,6 +734,10 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "connection", $connected);
} elsif($msgtype eq "CubeDutyCycleState") {
my $dutycycle = $args[0];
readingsBulkUpdate($shash, "dutycycle", $dutycycle);
} elsif(grep /^$msgtype$/, ("HeatingThermostatConfig", "WallThermostatConfig")) {
readingsBulkUpdate($shash, "ecoTemperature", MAX_SerializeTemperature($args[0]));
readingsBulkUpdate($shash, "comfortTemperature", MAX_SerializeTemperature($args[1]));