yepzon-locationer/thingy_lib/src/config.rs

49 lines
1.5 KiB
Rust

use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Config {
pub api_key: String,
pub tags_url: String,
pub tag_url: String,
pub states_url: String,
pub locations_url: String,
pub current_locations_url: String,
pub sharetoken_url: String,
pub timestamp_format: String,
pub timedate_format: String,
pub date_format: String,
pub time_format: String,
pub throttle: u32,
pub nicknames: HashMap<String, String>,
}
impl Default for Config {
fn default() -> Config {
Config {
api_key: "<your API key here from https://developers.yepzon.com/>".to_owned(),
tags_url: "https://platform.yepzon.com/tags".to_owned(),
tag_url: "https://platform.yepzon.com/tags/{tag}".to_owned(),
states_url: "https://platform.yepzon.com/tags/{tag}/states".to_owned(),
locations_url: "https://platform.yepzon.com/tags/{tag}/locations/{state}".to_owned(),
current_locations_url: "https://platform.yepzon.com/tags/{tag}/locations".to_owned(),
sharetoken_url: "https://platform.yepzon.com/tags/{tag}/sharetoken".to_owned(),
timestamp_format: "%Y-%m-%dT%H:%M:%S%.fZ".to_owned(),
timedate_format: "%d.%m.%Y-%H:%M:%S".to_owned(),
date_format: "%d.%m.%Y".to_owned(),
time_format: "%H:%M:%S".to_owned(),
throttle: 9,
nicknames: HashMap::new(),
}
}
}