mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
10_ZWave.pm/00_ZWDongle.pm: new attribute helpSites (Forum #60424)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12583 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b50db000c1
commit
a7409d1f27
@ -89,7 +89,9 @@ ZWDongle_Initialize($)
|
|||||||
$hash->{AttrFn} = "ZWDongle_Attr";
|
$hash->{AttrFn} = "ZWDongle_Attr";
|
||||||
$hash->{UndefFn} = "ZWDongle_Undef";
|
$hash->{UndefFn} = "ZWDongle_Undef";
|
||||||
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 model:ZWDongle disable:0,1 ".
|
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 model:ZWDongle disable:0,1 ".
|
||||||
"homeId networkKey neighborListPos neighborListFmt";
|
"helpSites:multiple,pepper,alliance homeId networkKey ".
|
||||||
|
"neighborListPos neighborListFmt";
|
||||||
|
|
||||||
$hash->{FW_detailFn} = "ZWDongle_fhemwebFn";
|
$hash->{FW_detailFn} = "ZWDongle_fhemwebFn";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +180,7 @@ ZWDongle_nlData($)
|
|||||||
for my $e (@a) {
|
for my $e (@a) {
|
||||||
my $h = $defs{$e};
|
my $h = $defs{$e};
|
||||||
next if($h->{ZWaveSubDevice} ne "no");
|
next if($h->{ZWaveSubDevice} ne "no");
|
||||||
$h->{IMAGE} = ZWave_getPic(ReadingsVal($e, "modelId", ""));
|
$h->{IMAGE} = ZWave_getPic($d, ReadingsVal($e, "modelId", ""));
|
||||||
|
|
||||||
my $nl = ReadingsVal($e, "neighborList", "");
|
my $nl = ReadingsVal($e, "neighborList", "");
|
||||||
$nl = ReadingsVal($d, "neighborList_".hex($h->{nodeIdHex}), "")
|
$nl = ReadingsVal($d, "neighborList_".hex($h->{nodeIdHex}), "")
|
||||||
@ -1148,6 +1150,11 @@ ZWDongle_Ready($)
|
|||||||
<li><a href="#do_not_notify">do_not_notify</a></li>
|
<li><a href="#do_not_notify">do_not_notify</a></li>
|
||||||
<li><a href="#model">model</a></li>
|
<li><a href="#model">model</a></li>
|
||||||
<li><a href="#disable">disable</a></li>
|
<li><a href="#disable">disable</a></li>
|
||||||
|
<li><a name="helpSites">helpSites</a><br>
|
||||||
|
Comma separated list of Help Sites to get device pictures from or to
|
||||||
|
show a link to in the detailed window. Valid values are pepper
|
||||||
|
and alliance.
|
||||||
|
</li>
|
||||||
<li><a name="homeId">homeId</a><br>
|
<li><a name="homeId">homeId</a><br>
|
||||||
Stores the homeId of the dongle. Is a workaround for some buggy dongles,
|
Stores the homeId of the dongle. Is a workaround for some buggy dongles,
|
||||||
wich sometimes report a wrong/nonexisten homeId (Forum #35126)</li>
|
wich sometimes report a wrong/nonexisten homeId (Forum #35126)</li>
|
||||||
|
@ -572,7 +572,7 @@ our %zwave_deviceSpecial;
|
|||||||
my $zwave_cryptRijndael = 0;
|
my $zwave_cryptRijndael = 0;
|
||||||
my $zwave_lastHashSent;
|
my $zwave_lastHashSent;
|
||||||
my (%zwave_link, %zwave_img);
|
my (%zwave_link, %zwave_img);
|
||||||
my @helpSites = ("alliance", "pepper");
|
my $zwave_helpSites = "alliance,pepper";
|
||||||
|
|
||||||
# standard definitions for regular expression
|
# standard definitions for regular expression
|
||||||
# naming scheme: p<number of returned groups>_name
|
# naming scheme: p<number of returned groups>_name
|
||||||
@ -630,7 +630,7 @@ ZWave_Initialize($)
|
|||||||
|
|
||||||
################
|
################
|
||||||
# Read in the pepper/alliance translation table
|
# Read in the pepper/alliance translation table
|
||||||
for my $n (@helpSites) {
|
for my $n (split(",", $zwave_helpSites)) {
|
||||||
my $fn = $attr{global}{modpath}."/FHEM/lib/zwave_${n}links.csv.gz";
|
my $fn = $attr{global}{modpath}."/FHEM/lib/zwave_${n}links.csv.gz";
|
||||||
my $gz = gzopen($fn, "rb");
|
my $gz = gzopen($fn, "rb");
|
||||||
if($gz) {
|
if($gz) {
|
||||||
@ -4574,11 +4574,12 @@ ZWave_helpFn($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
ZWave_getPic($)
|
ZWave_getPic($$)
|
||||||
{
|
{
|
||||||
my ($model) = @_;
|
my ($iodev, $model) = @_;
|
||||||
|
|
||||||
for my $n (@helpSites) {
|
my $hs = AttrVal($iodev, "helpSites", $zwave_helpSites);
|
||||||
|
for my $n (split(",", $hs)) {
|
||||||
my $img = $zwave_img{$n}{$model};
|
my $img = $zwave_img{$n}{$model};
|
||||||
next if(!$img);
|
next if(!$img);
|
||||||
my $fn = $attr{global}{modpath}."/www/deviceimages/zwave/$img";
|
my $fn = $attr{global}{modpath}."/www/deviceimages/zwave/$img";
|
||||||
@ -4605,8 +4606,11 @@ ZWave_fhemwebFn($$$$)
|
|||||||
|
|
||||||
my $pl = ""; # Pepper link and image
|
my $pl = ""; # Pepper link and image
|
||||||
my $model = ReadingsVal($d, "modelId", "");
|
my $model = ReadingsVal($d, "modelId", "");
|
||||||
if($model) {
|
return '' if (!$model);
|
||||||
for my $n (@helpSites) {
|
|
||||||
|
my $iodev = $defs{$d}{IODev}{NAME};
|
||||||
|
my $hs = AttrVal($iodev, "helpSites", $zwave_helpSites);
|
||||||
|
for my $n (split(",", $hs)) {
|
||||||
my $link = $zwave_link{$n}{$model};
|
my $link = $zwave_link{$n}{$model};
|
||||||
next if(!$link);
|
next if(!$link);
|
||||||
$pl .= "<div class='detLink ZWPepper'>";
|
$pl .= "<div class='detLink ZWPepper'>";
|
||||||
@ -4617,13 +4621,12 @@ ZWave_fhemwebFn($$$$)
|
|||||||
$pl .= "</div>";
|
$pl .= "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $img = ZWave_getPic($model);
|
my $img = ZWave_getPic($iodev, $model);
|
||||||
if($img && !$FW_ss) {
|
if($img && !$FW_ss) {
|
||||||
$pl .= "<div class='img'".($FW_tp?"":" style='float:right'").">";
|
$pl .= "<div class='img'".($FW_tp?"":" style='float:right'").">";
|
||||||
$pl .= "<img style='max-width:96;max-height:96px;' src='$img'>";
|
$pl .= "<img style='max-width:96;max-height:96px;' src='$img'>";
|
||||||
$pl .= "</div>";
|
$pl .= "</div>";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
"<div id='ZWHelp' class='makeTable help'></div>$pl".
|
"<div id='ZWHelp' class='makeTable help'></div>$pl".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user