feat: Updates tracking state of sensors

This commit is contained in:
2024-11-20 22:43:05 -05:00
parent e44c1c24c5
commit c4c4fed4bc
3 changed files with 39 additions and 34 deletions

View File

@@ -84,12 +84,11 @@ public struct TemperatureAndHumiditySensor: Identifiable, Sendable {
/// Check whether any of the sensor values have changed and need processed.
///
/// - Note: Setting a value will set to both the temperature and humidity properties.
public var needsProcessed: Bool {
get { $temperature.needsProcessed || $humidity.needsProcessed }
set {
$temperature.needsProcessed = newValue
$humidity.needsProcessed = newValue
}
public var needsProcessed: Bool { $temperature.needsProcessed || $humidity.needsProcessed }
public mutating func setHasProcessed() {
$temperature.setHasProcessed()
$humidity.setHasProcessed()
}
/// Represents the different locations of a temperature and humidity sensor, which can