feat: changed value of the sensor when read is not available. Was: read unsuccessful -> do not change the value (previous is visible). Now: read unsuccessful -> 0 value. (#668)

This commit is contained in:
Serhiy Mytrovtsiy
2021-10-21 18:25:42 +02:00
parent d4c5a7c043
commit 23de767e53

View File

@@ -87,9 +87,7 @@ internal class x86_SensorsReader: SensorsReader {
public override func read() {
for i in 0..<self.list.count {
if let newValue = SMC.shared.getValue(self.list[i].key) {
self.list[i].value = newValue
}
self.list[i].value = SMC.shared.getValue(self.list[i].key) ?? 0
}
self.callback(self.list)
}