kopia lustrzana https://github.com/bertrik/ttnhabbridge
Add in configs for AmatuerSondehub
rodzic
3fc8c24f9e
commit
3de5d954a9
|
@ -2,6 +2,7 @@ package nl.sikken.bertrik;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import nl.sikken.bertrik.hab.habitat.AmatuerSondehubConfig;
|
||||
import nl.sikken.bertrik.hab.habitat.HabitatConfig;
|
||||
import nl.sikken.bertrik.hab.lorawan.MqttConfig;
|
||||
|
||||
|
@ -20,6 +21,9 @@ final class TtnHabBridgeConfig {
|
|||
@JsonProperty("habitat")
|
||||
private final HabitatConfig habitatConfig = new HabitatConfig();
|
||||
|
||||
@JsonProperty("amatuerSondehub")
|
||||
private final AmatuerSondehubConfig amatuerSondehubConfig = new AmatuerSondehubConfig();
|
||||
|
||||
@JsonProperty("gwCacheExpirationTime")
|
||||
private final int gwCacheExpirationTime = 600; // seconds
|
||||
|
||||
|
@ -34,6 +38,10 @@ final class TtnHabBridgeConfig {
|
|||
return heliumConfig;
|
||||
}
|
||||
|
||||
public AmatuerSondehubConfig getAmatuerSondehubConfig() {
|
||||
return amatuerSondehubConfig;
|
||||
}
|
||||
|
||||
public HabitatConfig getHabitatConfig() {
|
||||
return habitatConfig;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package nl.sikken.bertrik.hab.habitat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public final class AmatuerSondehubConfig {
|
||||
|
||||
@JsonProperty("url")
|
||||
private final String url;
|
||||
|
||||
@JsonProperty("timeout")
|
||||
private final int timeout;
|
||||
|
||||
public AmatuerSondehubConfig() {
|
||||
this("https://api.v2.sondehub.org/amateur/telemetry", 60);
|
||||
}
|
||||
|
||||
public AmatuerSondehubConfig(String url, int timeout) {
|
||||
this.url = url;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
}
|
Ładowanie…
Reference in New Issue