Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/components/systemmonitor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def check_required_arg(value: Any) -> Any:
"soc-thermal 1",
"soc_thermal 1",
"Tctl",
"cpu0-thermal",
]


Expand Down Expand Up @@ -504,7 +505,9 @@ def _read_cpu_temperature() -> float | None:
# In case the label is empty (e.g. on Raspberry PI 4),
# construct it ourself here based on the sensor key name.
_label = f"{name} {i}" if not entry.label else entry.label
if _label in CPU_SENSOR_PREFIXES:
# check both name and label because some systems embed cpu# in the
# name, which makes label not match because label adds cpu# at end.
if _label in CPU_SENSOR_PREFIXES or name in CPU_SENSOR_PREFIXES:
return cast(float, round(entry.current, 1))

return None