Migrate integrations w-z to extend SensorEntity (#48217)

This commit is contained in:
Erik Montnemery 2021-03-22 19:50:29 +01:00 committed by GitHub
parent 783b453bbe
commit 0c086b5067
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 72 additions and 79 deletions

View file

@ -5,6 +5,7 @@ from homeassistant.components.sensor import (
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
SensorEntity,
)
from homeassistant.const import DEGREE, PRESSURE_MBAR, TEMP_CELSIUS
from homeassistant.core import callback
@ -58,7 +59,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_dispatcher_connect(hass, CREATE_ENTITY_SIGNAL, _create_entity)
class NumberEntity(WiffiEntity):
class NumberEntity(WiffiEntity, SensorEntity):
"""Entity for wiffi metrics which have a number value."""
def __init__(self, device, metric, options):
@ -100,7 +101,7 @@ class NumberEntity(WiffiEntity):
self.async_write_ha_state()
class StringEntity(WiffiEntity):
class StringEntity(WiffiEntity, SensorEntity):
"""Entity for wiffi metrics which have a string value."""
def __init__(self, device, metric, options):