Fix CPUSpeed with missing info (#66339)

This commit is contained in:
Franck Nijhof 2022-02-11 19:38:55 +01:00 committed by GitHub
parent 8ff987d90c
commit 2f220b27d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View file

@ -81,8 +81,8 @@ class CPUSpeedSensor(SensorEntity):
if info:
self._attr_extra_state_attributes = {
ATTR_ARCH: info["arch_string_raw"],
ATTR_BRAND: info["brand_raw"],
ATTR_ARCH: info.get("arch_string_raw"),
ATTR_BRAND: info.get("brand_raw"),
}
if HZ_ADVERTISED in info:
self._attr_extra_state_attributes[ATTR_HZ] = round(