Add icons to NetAtmo sensors
parent
027d97321f
commit
613f8d0bd2
|
@ -23,11 +23,11 @@ REQUIREMENTS = [
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SENSOR_TYPES = {
|
||||
'temperature': ['Temperature', TEMP_CELCIUS],
|
||||
'co2': ['CO2', 'ppm'],
|
||||
'pressure': ['Pressure', 'mbar'],
|
||||
'noise': ['Noise', 'dB'],
|
||||
'humidity': ['Humidity', '%']
|
||||
'temperature': ['Temperature', TEMP_CELCIUS, 'mdi:thermometer'],
|
||||
'co2': ['CO2', 'ppm', 'mdi:cloud'],
|
||||
'pressure': ['Pressure', 'mbar', 'mdi:gauge'],
|
||||
'noise': ['Noise', 'dB', 'mdi:volume-high'],
|
||||
'humidity': ['Humidity', '%', 'mdi:water-percent']
|
||||
}
|
||||
|
||||
CONF_SECRET_KEY = 'secret_key'
|
||||
|
@ -104,6 +104,10 @@ class NetAtmoSensor(Entity):
|
|||
def name(self):
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
return SENSOR_TYPES[self.type][2]
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
""" Returns the state of the device. """
|
||||
|
|
Loading…
Reference in New Issue