Migrate integrations i-m to extend SensorEntity (#48213)
This commit is contained in:
parent
64bc9a8196
commit
fdf97eaca3
62 changed files with 152 additions and 157 deletions
|
@ -1,6 +1,7 @@
|
|||
"""Support for IOTA wallet sensors."""
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import CONF_NAME
|
||||
|
||||
from . import CONF_WALLETS, IotaDevice
|
||||
|
@ -27,7 +28,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
add_entities(sensors)
|
||||
|
||||
|
||||
class IotaBalanceSensor(IotaDevice):
|
||||
class IotaBalanceSensor(IotaDevice, SensorEntity):
|
||||
"""Implement an IOTA sensor for displaying wallets balance."""
|
||||
|
||||
def __init__(self, wallet_config, iota_config):
|
||||
|
@ -60,7 +61,7 @@ class IotaBalanceSensor(IotaDevice):
|
|||
self._state = self.api.get_inputs()["totalBalance"]
|
||||
|
||||
|
||||
class IotaNodeSensor(IotaDevice):
|
||||
class IotaNodeSensor(IotaDevice, SensorEntity):
|
||||
"""Implement an IOTA sensor for displaying attributes of node."""
|
||||
|
||||
def __init__(self, iota_config):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue