From f4313e365c69922e3b820f609819609f27ea4e23 Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Sat, 8 Dec 2012 00:28:55 +0000 Subject: [PATCH] MAX: fix possible values for associate git-svn-id: https://svn.fhem.de/fhem/trunk@2281 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_MAX.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/10_MAX.pm b/fhem/FHEM/10_MAX.pm index 2415cc8a1..3d18a55e2 100755 --- a/fhem/FHEM/10_MAX.pm +++ b/fhem/FHEM/10_MAX.pm @@ -238,12 +238,18 @@ MAX_Set($@) my $removeDevice = exists($hash->{IODev}{RemoveDevice}) ? " removeDevice" : ""; my $templist = join(",",map { sprintf("%2.1f",$_/2) } (9..61)); my $ret = "Unknown argument $setting, choose one of wakeUp factoryReset groupid$removeDevice"; - my $assoclist = join(",", map { $_->{type} ~~ ["HeatingThermostat", "WallMountedThermostat"] ? $_->{NAME} : () } values %{$modules{MAX}{defptr}}); + + my $assoclist; + #Build list of devices which this device can be associated to + if($hash->{type} eq "HeatingThermostat") { + $assoclist = join(",", map { $_->{type} ~~ ["HeatingThermostat", "WallMountedThermostat", "ShutterContact"] ? $_->{NAME} : () } values %{$modules{MAX}{defptr}}); + } elsif($hash->{type} ~~ ["ShutterContact", "WallMountedThermostat"]) { + $assoclist = join(",", map { $_->{type} eq "HeatingThermostat" ? $_->{NAME} : () } values %{$modules{MAX}{defptr}}); + } if($hash->{type} eq "HeatingThermostat") { #Create numbers from 4.5 to 30.5 my $templistOffset = join(",",map { sprintf("%2.1f",($_-7)/2) } (0..14)); - return "$ret associate:$assoclist desiredTemperature:eco,comfort,boost,auto,$templist ecoTemperature:$templist comfortTemperature:$templist measurementOffset:$templistOffset maximumTemperature:$templist minimumTemperature:$templist windowOpenTemperature:$templist windowOpenDuration"; } elsif($hash->{type} eq "WallMountedThermostat") {