From 05f2693c6db3aebcf4c1c402be2f9f42a337bea1 Mon Sep 17 00:00:00 2001 From: Risiko Date: Sat, 7 Mar 2020 18:15:44 +0000 Subject: [PATCH] 98_weekprofile: ignore dummy, readonly and ignored devices git-svn-id: https://svn.fhem.de/fhem/trunk@21373 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_weekprofile.pm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/98_weekprofile.pm b/fhem/FHEM/98_weekprofile.pm index e7afa74ce..88550bf33 100644 --- a/fhem/FHEM/98_weekprofile.pm +++ b/fhem/FHEM/98_weekprofile.pm @@ -110,6 +110,16 @@ sub weekprofile_getDeviceType($$;$) { my ($me,$device,$sndrcv) = @_; + if (IsDummy($device)){ + Log3 $me, 4, "$me(getDeviceType): $device is dummy - ignored"; + return undef; + } + + if (IsIgnored($device)){ + Log3 $me, 4, "$me(getDeviceType): $device is ignored"; + return undef; + } + $sndrcv = "RCV" if (!defined($sndrcv)); # determine device type @@ -127,6 +137,12 @@ sub weekprofile_getDeviceType($$;$) if ($devType =~ /CUL_HM/){ my $model = AttrVal($device,"model",""); + my $readonly = AttrVal($device,"readOnly",0); + if ($readonly) { + Log3 $me, 4, "$me(getDeviceType): $devHash->{NAME} is readonly - ignored"; + return undef; + } + #models: HM-TC-IT-WM-W-EU, HM-CC-RT-DN, HM-CC-TC unless ($model =~ m/.*HM-[C|T]C-.*/) { Log3 $me, 4, "$me(getDeviceType): $devHash->{NAME}, model $model is not supported"; @@ -149,13 +165,19 @@ sub weekprofile_getDeviceType($$;$) $type = "CUL_HM" if ( ($model =~ m/.*HM-CC-RT.*/) && ($channel == 4) ); $type = "CUL_HM" if ( ($model =~ m/.*HM-TC.*/) && ($channel == 2) ); - $type = "CUL_HM" if ( ($model =~ m/.*HM-CC-TC.*/) && ($channel == 2) ); + $type = "CUL_HM" if ( ($model =~ m/.*HM-CC-TC.*/) && ($channel == 2) ); } #avoid max shutter contact elsif ( ($devType =~ /MAX/) && ($devHash->{type} =~ /.*Thermostat.*/) ){ $type = "MAX"; } elsif ( $devType =~ /HMCCUDEV/){ + my $readonly = AttrVal($device,"readOnly",0); + if ($readonly) { + Log3 $me, 4, "$me(getDeviceType): $devHash->{NAME} is readonly - ignored"; + return undef; + } + my $model = $devHash->{ccutype}; if (!defined($model)) { Log3 $me, 2, "$me(getDeviceType): ccutype not defined - take HM-xxx (HMCCU_HM)";