Migrate integrations i-m to extend SensorEntity (#48213)

This commit is contained in:
Erik Montnemery 2021-03-22 19:59:03 +01:00 committed by GitHub
parent 64bc9a8196
commit fdf97eaca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 152 additions and 157 deletions

View file

@ -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):