From 00590b681153d8fbb15846c14d73c20b1fb47def Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Fri, 13 Jan 2023 12:53:22 +0000 Subject: [PATCH] 49_SSCamSTRM: change behavior of hideDisplayName, hideDisplayNameFTUI if device is disabled git-svn-id: https://svn.fhem.de/fhem/trunk@27041 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/49_SSCamSTRM.pm | 40 +++++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5c8085c75..e9d80d5aa 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - change: 49_SSCamSTRM: change behavior of hideDisplayName, + hideDisplayNameFTUI if device is disabled - change: 93_DbLog: attribute 'bulkInsert' renamed to 'insertMode', fixed some reported problems, Forum:#130588 - change: 93_DbRep: write TYPE uppercase with writeToDB option, diff --git a/fhem/FHEM/49_SSCamSTRM.pm b/fhem/FHEM/49_SSCamSTRM.pm index 9ae25d2b2..61ffd6412 100644 --- a/fhem/FHEM/49_SSCamSTRM.pm +++ b/fhem/FHEM/49_SSCamSTRM.pm @@ -3,7 +3,7 @@ ######################################################################################################################### # 49_SSCamSTRM.pm # -# (c) 2018-2022 by Heiko Maaz +# (c) 2018-2023 by Heiko Maaz # forked from 98_weblink.pm by Rudolf König # e-mail: Heiko dot Maaz at t-online dot de # @@ -91,6 +91,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "2.15.3" => "13.01.2023 change behavior of hideDisplayName, hideDisplayNameFTUI if device is disabled ", "2.15.2" => "01.01.2022 minor code change in _setpopupStream ", "2.15.1" => "15.10.2021 fix warnings 'my variable masks earlier' ", "2.15.0" => "27.09.2021 model lastsnap: add setter snap ", @@ -239,8 +240,7 @@ sub Define { $hash->{HELPER}{MODMETAABSENT} = 1 if($modMetaAbsent); # Modul Meta.pm nicht vorhanden - # Versionsinformationen setzen - setVersionInfo($hash); + setVersionInfo($hash); # Versionsinformationen setzen my @r; push @r, "adoptSubset:--reset--" if(IsModelMaster($hash)); # Init für FTUI Subset wenn benutzt (Attr adoptSubset) @@ -584,7 +584,7 @@ sub Get { } if ($cmd eq "ftui") { - return streamAsHtml($hash,"ftui"); + return streamAsHtml($hash, 'ftui'); } return; @@ -677,21 +677,24 @@ sub FwFn { my $ret = ""; if(IsModelMaster($hash) && $clink) { - my $alias = AttrVal($name, "alias", $name); # Linktext als Aliasname oder Devicename setzen - my $lang = AttrVal("global", "language", "EN"); + my $alias = AttrVal ($name, 'alias', $name); # Linktext als Aliasname oder Devicename setzen + my $lang = AttrVal ('global', 'language', 'EN'); my $txt = "is Streaming master of"; $txt = "ist Streaming Master von " if($lang eq "DE"); my $dlink = "$alias $txt "; $dlink = "$alias $txt " if(AttrVal($name, "noLink", 0)); # keine Links im Stream-Dev generieren - $ret .= "$dlink " if(!AttrVal($name,"hideDisplayName",0)); + + if(!AttrVal ($name, 'hideDisplayName', 0) && !IsDisabled($name)) { + $ret .= "$dlink "; + } } if(IsDisabled($name)) { - if(AttrVal($name, "hideDisplayName", 0)) { - $ret .= "Stream-device $name is disabled"; + if(AttrVal($name, 'hideDisplayName', 0)) { + $ret .= "Stream-device is disabled"; } else { - $ret .= "Stream-device is disabled"; + $ret .= "Stream-device $name is disabled"; } } else { @@ -699,7 +702,7 @@ sub FwFn { $ret .= sDevsWidget($name) if(IsModelMaster($hash)); } - my $al = AttrVal($name, "autoRefresh", 0); # Autorefresh nur des aufrufenden FHEMWEB-Devices + my $al = AttrVal ($name, 'autoRefresh', 0); # Autorefresh nur des aufrufenden FHEMWEB-Devices if($al) { InternalTimer(gettimeofday()+$al, "FHEM::SSCamSTRM::webRefresh", $hash, 0); @@ -821,11 +824,12 @@ sub streamAsHtml { if($ftui && $ftui eq "ftui") { $ftui = 1; - } else { + } + else { $ftui = 0; } - my $clink = ReadingsVal($name, "clientLink", ""); + my $clink = ReadingsVal ($name, 'clientLink', ''); explodeLinkData ($hash, $clink, 0); @@ -844,11 +848,15 @@ sub streamAsHtml { my $ret = ""; if(IsDisabled($name)) { - if(AttrVal($name,"hideDisplayName",0)) { - $ret .= "Stream-device $name is disabled"; - } else { + if (!$ftui && AttrVal ($name, 'hideDisplayName', 0)) { $ret .= "Stream-device is disabled"; } + elsif ($ftui && AttrVal ($name, 'hideDisplayNameFTUI', 0)) { + $ret .= "Stream-device is disabled"; + } + else { + $ret .= "Stream-device $name is disabled"; + } } else { $ret .= $html;