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

@ -7,7 +7,7 @@ from i2csense.bme280 import BME280 # 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_MONITORED_CONDITIONS,
CONF_NAME,
@ -15,7 +15,6 @@ from homeassistant.const import (
TEMP_FAHRENHEIT,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.util.temperature import celsius_to_fahrenheit
@ -136,7 +135,7 @@ class BME280Handler:
self.sensor.update(first_reading)
class BME280Sensor(Entity):
class BME280Sensor(SensorEntity):
"""Implementation of the BME280 sensor."""
def __init__(self, bme280_client, sensor_type, temp_unit, name):