feat: added temperature unit update on each read in the Sensors popup (#2078)

This commit is contained in:
Serhiy Mytrovtsiy
2024-08-19 18:36:53 +02:00
parent d2b8a91e02
commit 9a72f3e01d

View File

@@ -318,7 +318,7 @@ internal class SensorView: NSStackView {
}
public func addHistoryPoint(_ sensor: Sensor_p) {
self.chartView.update(sensor.localValue)
self.chartView.update(sensor.localValue, sensor.unit)
}
private func open() {
@@ -435,7 +435,10 @@ internal class ChartSensorView: NSStackView {
fatalError("init(coder:) has not been implemented")
}
public func update(_ value: Double) {
public func update(_ value: Double, _ suffix: String) {
if self.chart?.suffix != suffix {
self.chart?.suffix = suffix
}
self.chart?.addValue(value/100)
}
}