mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add icon
This commit is contained in:
@@ -19,6 +19,7 @@ DEFAULT_NAME = "CPU speed"
|
||||
ATTR_VENDOR = 'Vendor ID'
|
||||
ATTR_BRAND = 'Brand'
|
||||
ATTR_HZ = 'GHz Advertised'
|
||||
ICON = 'mdi:pulse'
|
||||
|
||||
|
||||
# pylint: disable=unused-variable
|
||||
@@ -62,6 +63,11 @@ class CpuSpeedSensor(Entity):
|
||||
ATTR_HZ: round(self.info['hz_advertised_raw'][0]/10**9, 2)
|
||||
}
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
""" Icon to use in the frontend, if any. """
|
||||
return ICON
|
||||
|
||||
def update(self):
|
||||
""" Gets the latest data and updates the state. """
|
||||
from cpuinfo import cpuinfo
|
||||
|
||||
Reference in New Issue
Block a user