From 525f3c5090687b01c8510a318aa8627255b66c4b Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Mon, 20 Jul 2020 16:27:33 +0000 Subject: [PATCH] 49_SSCam: contrib 9.5.0 git-svn-id: https://svn.fhem.de/fhem/trunk@22442 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/49_SSCamSTRM.pm | 42 ++++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/fhem/contrib/DS_Starter/49_SSCamSTRM.pm b/fhem/contrib/DS_Starter/49_SSCamSTRM.pm index b15894857..20efe4c67 100644 --- a/fhem/contrib/DS_Starter/49_SSCamSTRM.pm +++ b/fhem/contrib/DS_Starter/49_SSCamSTRM.pm @@ -131,9 +131,24 @@ my %fupgrade = ( # Fun 3 => { of => "SSCam_StreamDev", nf => "FHEM::SSCam::streamDev" }, ); -my %SSCAM_imc = ( # disbled String modellabhängig (SVS / CAM) - 0 => { 0 => "initialized", 1 => "inactive" }, - 1 => { 0 => "off", 1 => "inactive" }, +my %hvattr = ( # Hash zur Validierung von Attributen + autoRefresh => { master => 1, nomaster => 1 }, + autoRefreshFW => { master => 1, nomaster => 1 }, + disable => { master => 1, nomaster => 1 }, + forcePageRefresh => { master => 1, nomaster => 1 }, + genericStrmHtmlTag => { master => 0, nomaster => 1 }, + htmlattr => { master => 0, nomaster => 1 }, + htmlattrFTUI => { master => 0, nomaster => 1 }, + hideAudio => { master => 0, nomaster => 1 }, + hideButtons => { master => 0, nomaster => 1 }, + hideDisplayName => { master => 1, nomaster => 1 }, + hideDisplayNameFTUI => { master => 1, nomaster => 1 }, + noLink => { master => 1, nomaster => 1 }, + popupWindowSize => { master => 0, nomaster => 1 }, + popupStreamFW => { master => 0, nomaster => 1 }, + popupStreamTo => { master => 0, nomaster => 1 }, + ptzButtonSize => { master => 0, nomaster => 1 }, + ptzButtonSizeFTUI => { master => 0, nomaster => 1 }, ); my %sdevs = (); # Hash der vorhandenen Streaming Devices @@ -393,15 +408,26 @@ sub Get { return; } +################################################################ +# Attr +# $cmd can be "del" or "set" +# $name is device name +# aName and aVal are Attribute name and value ################################################################ sub Attr { my ($cmd,$name,$aName,$aVal) = @_; - my $hash = $defs{$name}; + my $hash = $defs{$name}; + my $model = $hash->{MODEL}; + my ($do,$val); - - # $cmd can be "del" or "set" - # $name is device name - # aName and aVal are Attribute name and value + + if ($model eq "master" && !$hvattr{$aName}{master}) { + return qq{The attribute "$aName" is only valid if MODEL is not "$model" !}; + } + + if ($model ne "master" && !$hvattr{$aName}{nomaster}) { + return qq{The attribute "$aName" is only valid if MODEL is "master" !}; + } if($aName eq "disable") { if($cmd eq "set") {