mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add missing baseclass for rituals perfume genie entities (#55166)
This commit is contained in:
parent
18f80c32d7
commit
9555a34691
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
|
||||
from pyrituals import Diffuser
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
@ -42,7 +43,7 @@ async def async_setup_entry(
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class DiffuserPerfumeSensor(DiffuserEntity):
|
||||
class DiffuserPerfumeSensor(DiffuserEntity, SensorEntity):
|
||||
"""Representation of a diffuser perfume sensor."""
|
||||
|
||||
def __init__(
|
||||
@ -64,7 +65,7 @@ class DiffuserPerfumeSensor(DiffuserEntity):
|
||||
return self._diffuser.perfume
|
||||
|
||||
|
||||
class DiffuserFillSensor(DiffuserEntity):
|
||||
class DiffuserFillSensor(DiffuserEntity, SensorEntity):
|
||||
"""Representation of a diffuser fill sensor."""
|
||||
|
||||
def __init__(
|
||||
@ -86,7 +87,7 @@ class DiffuserFillSensor(DiffuserEntity):
|
||||
return self._diffuser.fill
|
||||
|
||||
|
||||
class DiffuserBatterySensor(DiffuserEntity):
|
||||
class DiffuserBatterySensor(DiffuserEntity, SensorEntity):
|
||||
"""Representation of a diffuser battery sensor."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_BATTERY
|
||||
@ -104,7 +105,7 @@ class DiffuserBatterySensor(DiffuserEntity):
|
||||
return self._diffuser.battery_percentage
|
||||
|
||||
|
||||
class DiffuserWifiSensor(DiffuserEntity):
|
||||
class DiffuserWifiSensor(DiffuserEntity, SensorEntity):
|
||||
"""Representation of a diffuser wifi sensor."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_SIGNAL_STRENGTH
|
||||
|
@ -31,7 +31,7 @@ async def async_setup_entry(
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
class DiffuserSwitch(SwitchEntity, DiffuserEntity):
|
||||
class DiffuserSwitch(DiffuserEntity, SwitchEntity):
|
||||
"""Representation of a diffuser switch."""
|
||||
|
||||
_attr_icon = "mdi:fan"
|
||||
|
Loading…
x
Reference in New Issue
Block a user