98_GEOFANCY: add disabled attribute

git-svn-id: https://svn.fhem.de/fhem/trunk@13317 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
loredo
2017-02-03 08:02:06 +00:00
parent 98f6c4887d
commit d8db84a4fb

View File

@@ -69,7 +69,7 @@ sub GEOFANCY_Initialize($) {
$hash->{SetFn} = "GEOFANCY_Set"; $hash->{SetFn} = "GEOFANCY_Set";
$hash->{DefFn} = "GEOFANCY_Define"; $hash->{DefFn} = "GEOFANCY_Define";
$hash->{UndefFn} = "GEOFANCY_Undefine"; $hash->{UndefFn} = "GEOFANCY_Undefine";
$hash->{AttrList} = "devAlias " . $readingFnAttributes; $hash->{AttrList} = "devAlias disabled:0,1 " . $readingFnAttributes;
} }
################################### ###################################
@@ -194,6 +194,10 @@ sub GEOFANCY_CGI() {
"NOK No GEOFANCY device for webhook $link" ) "NOK No GEOFANCY device for webhook $link" )
unless ($name); unless ($name);
# return error if no such device
return ( "text/plain; charset=utf-8", "NOK disabled" )
if ( IsDisabled($name) );
# extract values from URI # extract values from URI
my $webArgs; my $webArgs;
foreach my $pv ( split( "&", $URI ) ) { foreach my $pv ( split( "&", $URI ) ) {