diff options
| author | diogo464 <[email protected]> | 2025-12-06 14:31:54 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-12-06 14:31:54 +0000 |
| commit | e5416e848c8caeed59e8aca6fb3e191fbc621b1b (patch) | |
| tree | bd086e6d96f7acf2e051d29c5ce2fee3be4ea5f5 /src/entity.rs | |
| parent | 0fbce715a32f5e05c2a66e5cc401105f72083ff5 (diff) | |
Refactor sensor API to support generic sensor types with configurable display precision
Replaced TemperatureSensor with a generic Sensor type that accepts sensor class, state class, unit, and display precision to support various sensor types. Added suggested_display_precision field to control decimal places in Home Assistant UI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'src/entity.rs')
| -rw-r--r-- | src/entity.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/entity.rs b/src/entity.rs index ac15921..ef2b9ad 100644 --- a/src/entity.rs +++ b/src/entity.rs | |||
| @@ -33,4 +33,5 @@ pub struct EntityConfig { | |||
| 33 | pub max: Option<f32>, | 33 | pub max: Option<f32>, |
| 34 | pub step: Option<f32>, | 34 | pub step: Option<f32>, |
| 35 | pub mode: Option<&'static str>, | 35 | pub mode: Option<&'static str>, |
| 36 | pub suggested_display_precision: Option<u8>, | ||
| 36 | } | 37 | } |
