Migrate integrations a-c to extend SensorEntity (#48210)

This commit is contained in:
Erik Montnemery 2021-03-22 12:37:16 +01:00 committed by GitHub
parent 1bb29bffbb
commit e0cd7072d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 139 additions and 139 deletions

View file

@ -6,10 +6,9 @@ from i2csense.bh1750 import BH1750 # pylint: disable=import-error
import smbus
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_NAME, DEVICE_CLASS_ILLUMINANCE, LIGHT_LUX
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
@ -94,7 +93,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities(dev, True)
class BH1750Sensor(Entity):
class BH1750Sensor(SensorEntity):
"""Implementation of the BH1750 sensor."""
def __init__(self, bh1750_sensor, name, unit, multiplier=1.0):