mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 12:46:03 +00:00
98_GEOFANCY.pm: add address as optional API parameter
git-svn-id: https://svn.fhem.de/fhem/trunk@9935 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
09ae4641a2
commit
32f0b17217
@ -181,6 +181,7 @@ sub GEOFANCY_CGI() {
|
|||||||
my $id = "";
|
my $id = "";
|
||||||
my $lat = "";
|
my $lat = "";
|
||||||
my $long = "";
|
my $long = "";
|
||||||
|
my $address = "-";
|
||||||
my $entry = "";
|
my $entry = "";
|
||||||
my $msg = "";
|
my $msg = "";
|
||||||
my $date = "";
|
my $date = "";
|
||||||
@ -330,6 +331,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
|
|||||||
$date = $webArgs->{date};
|
$date = $webArgs->{date};
|
||||||
$lat = $webArgs->{latitude};
|
$lat = $webArgs->{latitude};
|
||||||
$long = $webArgs->{longitude};
|
$long = $webArgs->{longitude};
|
||||||
|
$address = $webArgs->{address} if (defined($webArgs->{address}));
|
||||||
$device = $webArgs->{device};
|
$device = $webArgs->{device};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -397,7 +399,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
|
|||||||
|
|
||||||
# General readings
|
# General readings
|
||||||
readingsBulkUpdate( $hash, "state",
|
readingsBulkUpdate( $hash, "state",
|
||||||
"id:$id name:$locName trig:$entry date:$date lat:$lat long:$long dev:$device"
|
"id:$id name:$locName trig:$entry date:$date lat:$lat long:$long address:$address dev:$device"
|
||||||
);
|
);
|
||||||
|
|
||||||
$id = $locName if ( defined($locName) && $locName ne "" );
|
$id = $locName if ( defined($locName) && $locName ne "" );
|
||||||
@ -414,6 +416,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
|
|||||||
readingsBulkUpdate( $hash, "currLoc_" . $device, $id );
|
readingsBulkUpdate( $hash, "currLoc_" . $device, $id );
|
||||||
readingsBulkUpdate( $hash, "currLocLat_" . $device, $lat );
|
readingsBulkUpdate( $hash, "currLocLat_" . $device, $lat );
|
||||||
readingsBulkUpdate( $hash, "currLocLong_" . $device, $long );
|
readingsBulkUpdate( $hash, "currLocLong_" . $device, $long );
|
||||||
|
readingsBulkUpdate( $hash, "currLocAddr_" . $device, $address );
|
||||||
readingsBulkUpdate( $hash, "currLocTime_" . $device, $time );
|
readingsBulkUpdate( $hash, "currLocTime_" . $device, $time );
|
||||||
}
|
}
|
||||||
elsif ( $entry eq "exit" || $entry eq "0" ) {
|
elsif ( $entry eq "exit" || $entry eq "0" ) {
|
||||||
@ -447,6 +450,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
|
|||||||
readingsBulkUpdate( $hash, "currLoc_" . $device, "underway" );
|
readingsBulkUpdate( $hash, "currLoc_" . $device, "underway" );
|
||||||
readingsBulkUpdate( $hash, "currLocLat_" . $device, "-" );
|
readingsBulkUpdate( $hash, "currLocLat_" . $device, "-" );
|
||||||
readingsBulkUpdate( $hash, "currLocLong_" . $device, "-" );
|
readingsBulkUpdate( $hash, "currLocLong_" . $device, "-" );
|
||||||
|
readingsBulkUpdate( $hash, "currLocAddr_" . $device, "-" );
|
||||||
readingsBulkUpdate( $hash, "currLocTime_" . $device, $time );
|
readingsBulkUpdate( $hash, "currLocTime_" . $device, $time );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user