Migrate integrations t-v to extend SensorEntity (#48216)

This commit is contained in:
Erik Montnemery 2021-03-22 19:47:44 +01:00 committed by GitHub
parent c900e3030b
commit 783b453bbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 112 additions and 120 deletions

View file

@ -1,4 +1,5 @@
"""Support for Velbus sensors."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_POWER, ENERGY_KILO_WATT_HOUR
from . import VelbusEntity
@ -18,7 +19,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
async_add_entities(entities)
class VelbusSensor(VelbusEntity):
class VelbusSensor(VelbusEntity, SensorEntity):
"""Representation of a sensor."""
def __init__(self, module, channel, counter=False):