[semsportal] Allow confiuration with thing file (#10842)

* [semsportal] Allow portal and station cofiguration with .things file

Signed-off-by: Iwan Bron <bron@olisa.eu>

* Fix README.md warning

Signed-off-by: Iwan Bron <bron@olisa.eu>

* Make thing type better visible in documentation

Signed-off-by: Iwan Bron <bron@olisa.eu>

Co-authored-by: Iwan Bron <bron@olisa.eu>
This commit is contained in:
Iwan Bron
2021-06-12 19:58:21 +02:00
committed by GitHub
parent 1a06d78f22
commit cb256f6676
4 changed files with 39 additions and 8 deletions

View File

@@ -200,7 +200,7 @@ public class PortalHandler extends BaseBridgeHandler {
}
public long getUpdateInterval() {
return config.update;
return config.interval;
}
public List<Station> getAllStations() {

View File

@@ -32,5 +32,5 @@ public class SEMSPortalConfiguration {
*/
public String username = "";
public String password = "";
public int update = SEMSPortalBindingConstants.DEFAULT_UPDATE_INTERVAL_MINUTES;
public int interval = SEMSPortalBindingConstants.DEFAULT_UPDATE_INTERVAL_MINUTES;
}

View File

@@ -156,6 +156,12 @@ public class StationHandler extends BaseThingHandler {
private String getStationUUID() {
String uuid = getThing().getProperties().get(STATION_UUID);
if (uuid == null) {
Object uuidObj = getThing().getConfiguration().get(STATION_UUID);
if (uuidObj instanceof String) {
uuid = (String) uuidObj;
}
}
return uuid == null ? "" : uuid;
}