GEOFANCY: add INTERNALS

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@10325 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
loredo
2016-01-02 00:28:34 +00:00
parent 80e91c42df
commit 3b2b41aa55

View File

@@ -350,6 +350,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
# update ROOMMATE devices associated with this device UUID
my $matchingResident = 0;
delete $hash->{ROOMMATES};
if ( defined( $modules{ROOMMATE}{defptr} ) ) {
Log3 $name, 5, "GEOFANCY $name: found defptr for ROOMMATE\n"
. Dumper( $modules{ROOMMATE}{defptr} );
@@ -363,6 +364,9 @@ 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
Log3 $name, 5,
"GEOFANCY $name: ROOMMATE device $key has assigned UUIDs: $geofenceUUIDs";
$hash->{ROOMMATES} .= ",$key" if $hash->{ROOMMATES};
$hash->{ROOMMATES} = $key if !$hash->{ROOMMATES};
my @UUIDs = split( ',', $geofenceUUIDs );
if (@UUIDs) {
@@ -376,10 +380,10 @@ 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
}
}
}
}
}
last if $matchingResident eq "1";
}
}
delete $hash->{GUESTS};
# update GUEST devices associated with this device UUID
if ( $matchingResident == 0 && defined( $modules{GUEST}{defptr} ) ) {
@@ -390,6 +394,9 @@ 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
Log3 $name, 5,
"GEOFANCY $name: GUEST device $key has assigned UUIDs: $geofenceUUIDs";
$hash->{GUESTS} .= ",$key" if $hash->{GUESTS};
$hash->{GUESTS} = $key if !$hash->{GUESTS};
my @UUIDs = split( ',', $geofenceUUIDs );
if (@UUIDs) {
@@ -403,8 +410,6 @@ 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
}
}
}
last if $matchingResident eq "1";
}
}