Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
[Astro] added support for duplicate identification to avoid unnecessa…
Browse files Browse the repository at this point in the history
…ry discovery results (#4611)

* added support for duplicate identification to avoid unnecessary discovery results

Signed-off-by: Kai Kreuzer <kai@openhab.org>
  • Loading branch information
kaikreuzer authored and sjsf committed Nov 24, 2017
1 parent b6b3ce5 commit 31911b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Expand Up @@ -26,6 +26,9 @@
<channel-group id="position" typeId="position" />
<channel-group id="zodiac" typeId="moonZodiac" />
</channel-groups>

<representation-property>geolocation</representation-property>

<config-description-ref uri="thing-type:astro:config" />
</thing-type>

Expand Down
Expand Up @@ -54,6 +54,9 @@
<channel-group id="eclipse" typeId="sunEclipse" />
<channel-group id="phase" typeId="sunPhase" />
</channel-groups>

<representation-property>geolocation</representation-property>

<config-description-ref uri="thing-type:astro:config" />
</thing-type>

Expand Down
Expand Up @@ -117,9 +117,9 @@ public void createResults(PointType location) {
propGeolocation = String.format("%s,%s", location.getLatitude(), location.getLongitude());
}
thingDiscovered(DiscoveryResultBuilder.create(sunThing).withLabel("Local Sun")
.withProperty("geolocation", propGeolocation).build());
.withProperty("geolocation", propGeolocation).withRepresentationProperty("geolocation").build());
thingDiscovered(DiscoveryResultBuilder.create(moonThing).withLabel("Local Moon")
.withProperty("geolocation", propGeolocation).build());
.withProperty("geolocation", propGeolocation).withRepresentationProperty("geolocation").build());
}

@Reference
Expand Down

0 comments on commit 31911b1

Please sign in to comment.