Skip to content

Commit

Permalink
redfish: Fix type of Thermal.Fan Reading field
Browse files Browse the repository at this point in the history
End-user-impact: Now Redfish Thermal.Fan node provides Reading field
                 with valid type - int.

Signed-off-by: Igor Kononenko <[email protected]>
  • Loading branch information
ikmsk10 authored and AlexanderAmelkin committed Nov 15, 2022
1 parent a0b94d0 commit 7ca1ec9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/sensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Sensors :
ENTITY_DECL_FIELD(std::string, Id)
ENTITY_DECL_FIELD(std::string, Name)
ENTITY_DECL_FIELD_DEF(double, Reading, 0)
ENTITY_DECL_FIELD_DEF(int64_t, ReadingNatural, 0)
ENTITY_DECL_FIELD_ENUM(Unit, Unit, unkown)
ENTITY_DECL_FIELD_ENUM(Group, Group, sensors)

Expand Down Expand Up @@ -386,6 +387,11 @@ class Sensors :
}
}

void setNaturalReading(const DBusInstancePtr& instance) const
{
setFieldReadingNatural(instance, getFieldReading(instance));
}

void supplementByStaticFields(
const DBusInstancePtr& instance) const override
{
Expand All @@ -394,6 +400,7 @@ class Sensors :
this->setStatus(instance);
this->setState(instance);
this->setGroup(instance);
this->setNaturalReading(instance);
}
};

Expand All @@ -405,6 +412,7 @@ class Sensors :
this->createMember(fieldStatus);
this->createMember(fieldState);
this->createMember(fieldGroup);
this->createMember(fieldReadingNatural);
}
~Sensors() override = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Thermal:
- Name: UpperThresholdCritical
SourceField: Sensors::fieldHighCritical
- Name: Reading
SourceField: Sensors::fieldReading
SourceField: Sensors::fieldReadingNatural
- Name: ReadingUnits
SourceField: Sensors::fieldUnit
Enums:
Expand Down

0 comments on commit 7ca1ec9

Please sign in to comment.