summaryrefslogtreecommitdiffstats
path: root/widgets/temp.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/temp.go')
-rw-r--r--widgets/temp.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/widgets/temp.go b/widgets/temp.go
index 1b9f650..3e1b067 100644
--- a/widgets/temp.go
+++ b/widgets/temp.go
@@ -32,7 +32,7 @@ type TempWidget struct {
}
// TODO: state:deferred 156 Added temperatures for NVidia GPUs (azak-azkaran/master). Crashes on non-nvidia machines.
-func NewTempWidget(tempScale TempScale) *TempWidget {
+func NewTempWidget(tempScale TempScale, filter []string) *TempWidget {
self := &TempWidget{
Block: ui.NewBlock(),
updateInterval: time.Second * 5,
@@ -41,6 +41,15 @@ func NewTempWidget(tempScale TempScale) *TempWidget {
TempScale: tempScale,
}
self.Title = " Temperatures "
+ if len(filter) > 0 {
+ for _, t := range filter {
+ self.Data[t] = 0
+ }
+ } else {
+ for _, t := range devices.Devices(devices.Temperatures) {
+ self.Data[t] = 0
+ }
+ }
if tempScale == Fahrenheit {
self.TempThreshold = utils.CelsiusToFahrenheit(self.TempThreshold)