feat: sensor filter option

Filter out sensors based on regex matches.
This allows removing all unit text suffixes if, for example, the panel
image already contains the unit text.
This commit is contained in:
Markus Zehnder
2025-09-16 23:35:41 +02:00
parent 1e2616848a
commit 9af5deb204
7 changed files with 196 additions and 9 deletions
+4
View File
@@ -10,6 +10,7 @@ use anyhow::Context;
use image::{Rgb, Rgba};
use imageproc::definitions::HasWhite;
use log::{info, warn};
use regex::Regex;
use serde::de::Visitor;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_repr::{Deserialize_repr, Serialize_repr};
@@ -122,6 +123,9 @@ pub struct MonitorConfig {
/// Internal sensor label mapping
#[serde(skip)]
sensor_mapping: Option<HashMap<String, String>>,
/// Internal sensor filter
#[serde(skip)]
pub sensor_filter: Option<Vec<Regex>>,
}
impl MonitorConfig {