Add icons to NetAtmo sensors

pull/967/head
hydreliox 2016-01-22 21:15:07 +01:00
parent 027d97321f
commit 613f8d0bd2
1 changed files with 9 additions and 5 deletions

View File

@ -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. """