mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Avoid TypeError for state (#4897)
This commit is contained in:
parent
02517ae5ec
commit
7748867732
@ -77,7 +77,7 @@ class CoinMarketCapSensor(Entity):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return round(self._ticker.get('price_usd'), 2)
|
return round(float(self._ticker.get('price_usd')), 2)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user