Avoid TypeError for state (#4897)

pull/4939/head
Fabian Affolter 2016-12-16 07:14:59 +01:00 committed by Paulus Schoutsen
parent 02517ae5ec
commit 7748867732
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class CoinMarketCapSensor(Entity):
@property
def state(self):
"""Return the state of the sensor."""
return round(self._ticker.get('price_usd'), 2)
return round(float(self._ticker.get('price_usd')), 2)
@property
def unit_of_measurement(self):