sensor.speedtest: provide a default icon (#6207)

pull/5946/merge
Erik Eriksson 2017-02-24 18:40:52 +01:00 committed by Fabian Affolter
parent b27ba9660b
commit 8aa3124aa6
1 changed files with 7 additions and 0 deletions

View File

@ -34,6 +34,8 @@ CONF_DAY = 'day'
CONF_SERVER_ID = 'server_id'
CONF_MANUAL = 'manual'
ICON = 'mdi:speedometer'
SENSOR_TYPES = {
'ping': ['Ping', 'ms'],
'download': ['Download', 'Mbit/s'],
@ -103,6 +105,11 @@ class SpeedtestSensor(Entity):
"""Return the unit of measurement of this entity, if any."""
return self._unit_of_measurement
@property
def icon(self):
"""Return icon."""
return ICON
def update(self):
"""Get the latest data and update the states."""
data = self.speedtest_client.data