From 6ffdb2ea751e32750104f60f21cdcdee78aa8ee9 Mon Sep 17 00:00:00 2001 From: talkabout Date: Wed, 26 Aug 2015 19:35:34 +0000 Subject: [PATCH] 95_Dashboard: added support for alias attribute which, if set, is shown in the navigation instead of the device name git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9137 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/95_Dashboard.pm | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 3a84c8929..835661c29 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. + - bugfix: 95_Dashboard: support for alias attribute, which if set, is shown + instead of the device name in the left navigation - feature: 70_Pushover: Rewrite for Non-Blocking HttpUtils - much more readings - Support for emergency callback via push diff --git a/fhem/FHEM/95_Dashboard.pm b/fhem/FHEM/95_Dashboard.pm index b3a7b26a3..6077ae50e 100644 --- a/fhem/FHEM/95_Dashboard.pm +++ b/fhem/FHEM/95_Dashboard.pm @@ -339,6 +339,17 @@ sub Dashboard_attr($$$) { addToDevAttrList($name, "dashboard_tab" . ($1 + 1) . "backgroundimage"); } + # if an alias is set to the dashboard, replace the name shown in the left navigation + # by this alias + if ( + $cmd eq "set" + && $attrName =~ m/alias/ + ) { + my $url = '/dashboard/' . $name; + + $data{FWEXT}{$url}{NAME} = $attrVal; + } + return; }