Merge pull request #967 from HydrelioxGitHub/NetAtmo-icons

Add icons to NetAtmo sensors
This commit is contained in:
Paulus Schoutsen 2016-01-22 12:56:43 -08:00
commit 0042e7725d

View File

@ -23,11 +23,11 @@ REQUIREMENTS = [
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = { SENSOR_TYPES = {
'temperature': ['Temperature', TEMP_CELCIUS], 'temperature': ['Temperature', TEMP_CELCIUS, 'mdi:thermometer'],
'co2': ['CO2', 'ppm'], 'co2': ['CO2', 'ppm', 'mdi:cloud'],
'pressure': ['Pressure', 'mbar'], 'pressure': ['Pressure', 'mbar', 'mdi:gauge'],
'noise': ['Noise', 'dB'], 'noise': ['Noise', 'dB', 'mdi:volume-high'],
'humidity': ['Humidity', '%'] 'humidity': ['Humidity', '%', 'mdi:water-percent']
} }
CONF_SECRET_KEY = 'secret_key' CONF_SECRET_KEY = 'secret_key'
@ -104,6 +104,10 @@ class NetAtmoSensor(Entity):
def name(self): def name(self):
return self._name return self._name
@property
def icon(self):
return SENSOR_TYPES[self.type][2]
@property @property
def state(self): def state(self):
""" Returns the state of the device. """ """ Returns the state of the device. """