Skip to content

Commit

Permalink
SNCF : new binding
Browse files Browse the repository at this point in the history
Signed-off-by: clinique <gael@lhopital.org>
  • Loading branch information
clinique committed Nov 19, 2021
1 parent f533dae commit 4395608
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
/bundles/org.openhab.binding.smartmeter/ @msteigenberger
/bundles/org.openhab.binding.smartthings/ @BobRak
/bundles/org.openhab.binding.smhi/ @pacive
/bundles/org.openhab.binding.sncf/ @clinique
/bundles/org.openhab.binding.snmp/ @openhab/add-ons-maintainers
/bundles/org.openhab.binding.solaredge/ @alexf2015
/bundles/org.openhab.binding.solarlog/ @johannrichard
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,11 @@
<artifactId>org.openhab.binding.smhi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.sncf</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.snmp</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions bundles/org.openhab.binding.sncf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,3 @@ Bridge sncf:api:main "Bridge" [apiID="xxx-yyy-zzz"] {
station MyHouse "Krakow"[stopPointId="stop_point:SNCF:87561951:Bus"]
}
```

sncf.items:

```
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<features name="org.openhab.binding.sncf-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-sncf" description="Meteo Alerte Binding" version="${project.version}">
<feature name="openhab-binding-sncf" description="SNCF Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.sncf/${project.version}</bundle>
</feature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.jdt.annotation.Nullable;

/**
* Exception for errors when using the VolvoOnCall API
* Exception for errors when using the SNCF API
*
* @author Gaël L'hopital - Initial contribution
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void startScan() {
searchRange += 500;
try {
List<PlaceNearby> places = handler.discoverNearby(location, searchRange);
if (places != null && places.size() > 0) {
if (places != null && !places.isEmpty()) {
places.forEach(place -> {
String placeId = place.id;
String thingId = placeId.replace(":", "_").replace("-", "_").replace("stop_point_", "");
Expand All @@ -87,7 +87,7 @@ public void startScan() {
startScan();
}
} catch (SncfException e) {
logger.warn("Error calling Sncf Api : {}", e);
logger.warn("Error calling Sncf Api : {}", e.getMessage());
}
} else {
logger.info("Please set a system location to enable station discovery");
Expand Down
1 change: 1 addition & 0 deletions bundles/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
<module>org.openhab.binding.smartmeter</module>
<module>org.openhab.binding.smhi</module>
<module>org.openhab.binding.smartthings</module>
<module>org.openhab.binding.sncf</module>
<module>org.openhab.binding.snmp</module>
<module>org.openhab.binding.solaredge</module>
<module>org.openhab.binding.solarlog</module>
Expand Down

0 comments on commit 4395608

Please sign in to comment.