Skip to content

Commit

Permalink
feat: added temperature unit update on each read in the Sensors popup (
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban committed Aug 19, 2024
1 parent d2b8a91 commit 9a72f3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Modules/Sensors/popup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 9a72f3e

Please sign in to comment.