interface LogArray  extends Array<LogEntry>{}

interface LogEntry {
  timestamp: string,
  message_id: number,
  a: number,
  b: number,
  txt_short: string,
  txt_long: string
}

interface LogLocalisation extends Array<LogLocalisationEntry>{}

interface LogLocalisationEntry {
  msg_type: string,
  message: string
}

interface BackupHeader {
  timestamp: string,
  size: number
}

interface NetworkConfig {
  ap_ssid: string,
  ssid: string,
  password: string,
  mqtt_url: string,
  base_topic: string
}

interface FileList {
  total: number,
  used: number,
  files: FileInfo[],
  file_system_corrupt: string,
  iter_error: string,
}

interface FileInfo{
  filename: string,
  size: number,
}

interface NightLampConfig {
  enabled: boolean,
  night_lamp_hour_start: number,
  night_lamp_hour_end: number,
  night_lamp_only_when_dark: boolean,
  low_soc_cutoff: number,
  low_soc_restore: number
}

interface NightLampCommand {
  active: boolean
}

interface TankConfig {
  tank_sensor_enabled: boolean,
  tank_allow_pumping_if_sensor_error: boolean,
  tank_useable_ml: number,
  tank_warn_percent: number,
  tank_empty_percent: number,
  tank_full_percent: number,
}

interface PlantControllerConfig {
  network: NetworkConfig,
  tank: TankConfig,
  night_lamp: NightLampConfig,
  plants: PlantConfig[]
  timezone?: string,
}

interface PlantConfig {
  mode: string,
  target_moisture: number,
  pump_time_s: number,
  pump_cooldown_min: number,
  pump_hour_start: number,
  pump_hour_end: number,
  sensor_a: boolean,
  sensor_b: boolean,
  max_consecutive_pump_count: number,
  moisture_sensor_min_frequency: number | null;
  moisture_sensor_max_frequency: number | null;

}


interface SSIDList {
  ssids: [string]
}

interface TestPump {
  pump: number
}

interface SetTime {
  time: string
}

interface GetTime {
  rtc: string,
  native: string
}

interface Moistures {
  moisture_a: [string],
  moisture_b: [string],
}

interface VersionInfo {
  git_hash: string,
  build_time: string,
  partition: string
}

interface BatteryState {
  temperature: string
  voltage_milli_volt: string,
  current_milli_ampere: string,
  cycle_count: string,
  design_milli_ampere: string,
  remaining_milli_ampere: string,
  state_of_charge: string,
  state_of_health: string
}

interface TankInfo {
  /// is there enough water in the tank
  enough_water: boolean,
  /// warning that water needs to be refilled soon
  warn_level: boolean,
  /// estimation how many ml are still in tank
  left_ml: number | null,
  /// if there is was an issue with the water level sensor
  sensor_error: string | null,
  /// raw water sensor value
  raw: number | null,
  /// percent value
  percent: number | null,
  /// water in tank might be frozen
  water_frozen: boolean,
  /// water temperature
  water_temp: number | null,
  temp_sensor_error: string | null
}