mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Migrate integrations a-c to extend SensorEntity (#48210)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import ads
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
@@ -43,7 +43,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
add_entities([entity])
|
||||
|
||||
|
||||
class AdsSensor(AdsEntity):
|
||||
class AdsSensor(SensorEntity, AdsEntity):
|
||||
"""Representation of an ADS sensor entity."""
|
||||
|
||||
def __init__(self, ads_hub, ads_var, ads_type, name, unit_of_measurement, factor):
|
||||
|
||||
Reference in New Issue
Block a user