Skip to content

Commit

Permalink
devices/sensors: include Name field
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jul 21, 2021
1 parent c136613 commit 1bc9af0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion devices/sensors.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
package devices

type PowerSensor struct {
Name string
ID string
Name string
InputWatts float32
OutputWatts float32
LastOutputWatts float32
}

type TemperatureSensor struct {
ID string
Name string
ReadingCelsius float32
PhysicalContext string
}

type FanSensor struct {
ID string
Name string
Reading float32
PhysicalContext string
}

type ChassisHealth struct {
ID string
Name string
State string
Health string
}
4 changes: 4 additions & 0 deletions providers/redfish/sensors.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (c *Conn) TemperatureSensors(ctx context.Context) ([]*devices.TemperatureSe

t := &devices.TemperatureSensor{
ID: id,
Name: s.Name,
PhysicalContext: s.PhysicalContext,
ReadingCelsius: s.ReadingCelsius,
}
Expand Down Expand Up @@ -155,6 +156,7 @@ func (c *Conn) FanSensors(ctx context.Context) ([]*devices.FanSensor, error) {

t := &devices.FanSensor{
ID: id,
Name: s.Name,
PhysicalContext: s.PhysicalContext,
Reading: s.Reading,
}
Expand Down Expand Up @@ -192,6 +194,8 @@ func (c *Conn) ChassisHealth(ctx context.Context) ([]*devices.ChassisHealth, err

compatible++
h := &devices.ChassisHealth{
ID: ch.ID,
Name: ch.Name,
State: string(ch.Status.State),
Health: string(ch.Status.Health),
}
Expand Down

0 comments on commit 1bc9af0

Please sign in to comment.