Compare commits
2 Commits
b56704e234
...
37caa0beac
Author | SHA1 | Date | |
---|---|---|---|
37caa0beac | |||
0c1b9f75e9 |
@ -1,2 +1,2 @@
|
|||||||
# sensorCommunityAPI
|
# sensorCommunityAPI
|
||||||
a simple java programm, which stores sensor data from https://sensor.community to json files
|
a simple java program, which stores sensor data from https://sensor.community to json files
|
@ -8,16 +8,12 @@ public class Main {
|
|||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
DataStore store = new DataStore();
|
DataStore store = new DataStore();
|
||||||
JSONObject config = store.readJSON("config.json");
|
JSONObject config = store.readJSON("config.json");
|
||||||
if (config == null){
|
if (config == null) config = store.readJSON("example.config.json");
|
||||||
config = store.readJSON("example.config.json");
|
|
||||||
}
|
|
||||||
|
|
||||||
DataStoreBot bot = new DataStoreBot(
|
DataStoreBot bot = new DataStoreBot(
|
||||||
config.get("storePath").toString(),
|
config.get("storePath").toString(),
|
||||||
config.get("apiURL").toString()
|
config.get("apiURL").toString()
|
||||||
);
|
);
|
||||||
bot.setInterval(Integer.parseInt(
|
bot.setInterval((int)(long) config.get("interval"));
|
||||||
config.get("interval").toString()
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user