refactor: use repeated fields in `EnvironmentMetrics`

telemetry_repeated-env
andrekir 2023-10-26 10:18:11 -03:00
rodzic ca3d17c6af
commit c01e1dddfe
2 zmienionych plików z 54 dodań i 3 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
# options for nanopb
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
*EnvironmentMetrics.weather max_count:8
*EnvironmentMetrics.power max_count:8

Wyświetl plik

@ -37,6 +37,51 @@ message DeviceMetrics {
* Weather station or other environmental metrics
*/
message EnvironmentMetrics {
/*
* Temperature measured
*/
float temperature = 1 [deprecated = true];
/*
* Relative humidity percent measured
*/
float relative_humidity = 2 [deprecated = true];
/*
* Barometric pressure in hPA measured
*/
float barometric_pressure = 3 [deprecated = true];
/*
* Gas resistance in MOhm measured
*/
float gas_resistance = 4 [deprecated = true];
/*
* Voltage measured
*/
float voltage = 5 [deprecated = true];
/*
* Current measured
*/
float current = 6 [deprecated = true];
/*
* WeatherMetric readings
*/
repeated WeatherMetric weather = 7;
/*
* PowerMetric readings
*/
repeated PowerMetric power = 8;
}
/*
* Weather metrics
*/
message WeatherMetric {
/*
* Temperature measured
*/
@ -56,16 +101,21 @@ message EnvironmentMetrics {
* Gas resistance in MOhm measured
*/
float gas_resistance = 4;
}
/*
* Power metrics
*/
message PowerMetric {
/*
* Voltage measured
*/
float voltage = 5;
float voltage = 1;
/*
* Current measured
*/
float current = 6;
float current = 2;
}
/*