Add icon
This commit is contained in:
parent
0bb63bf3f0
commit
02efe903ab
1 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,7 @@ OPTION_TYPES = {
|
||||||
'miners_revenue_btc': ['Miners revenue', 'BTC'],
|
'miners_revenue_btc': ['Miners revenue', 'BTC'],
|
||||||
'market_price_usd': ['Market price', 'USD']
|
'market_price_usd': ['Market price', 'USD']
|
||||||
}
|
}
|
||||||
|
ICON = 'mdi:currency-btc'
|
||||||
|
|
||||||
# Return cached results if last scan was less then this time ago
|
# Return cached results if last scan was less then this time ago
|
||||||
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)
|
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)
|
||||||
|
@ -108,6 +109,11 @@ class BitcoinSensor(Entity):
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
return self._unit_of_measurement
|
return self._unit_of_measurement
|
||||||
|
|
||||||
|
@property
|
||||||
|
def icon(self):
|
||||||
|
""" Icon to use in the frontend, if any. """
|
||||||
|
return ICON
|
||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def update(self):
|
def update(self):
|
||||||
""" Gets the latest data and updates the states. """
|
""" Gets the latest data and updates the states. """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue