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