Set device_class on additional temperature sensors (#52960)
* Set device_class on additional temperature sensors * Apply suggestions from code review Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com> * Set device class for greeneye_monitor sensor * Set device class for bme280 and bme680 sensor Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
This commit is contained in:
parent
96f6e0e4a4
commit
e563dc0d7b
11 changed files with 74 additions and 25 deletions
|
@ -8,6 +8,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
|||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_OFFSET,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
DEVICE_DEFAULT_NAME,
|
||||
TEMP_FAHRENHEIT,
|
||||
)
|
||||
|
@ -68,6 +69,7 @@ class TemperSensor(SensorEntity):
|
|||
self.current_value = None
|
||||
self._name = name
|
||||
self.set_temper_device(temper_device)
|
||||
self._attr_device_class = DEVICE_CLASS_TEMPERATURE
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue