Migrate integrations w-z to extend SensorEntity (#48217)
This commit is contained in:
parent
783b453bbe
commit
0c086b5067
31 changed files with 72 additions and 79 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue