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:
Erik Montnemery 2021-07-13 14:20:47 +02:00 committed by GitHub
parent 96f6e0e4a4
commit e563dc0d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 74 additions and 25 deletions

View file

@ -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):