Set Sonos alarm and battery entity categories (#58340)
This commit is contained in:
parent
3672889609
commit
5a20d9fce3
3 changed files with 13 additions and 2 deletions
|
@ -2,7 +2,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
PERCENTAGE,
|
||||
)
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .const import SONOS_CREATE_BATTERY
|
||||
|
@ -25,6 +29,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
class SonosBatteryEntity(SonosEntity, SensorEntity):
|
||||
"""Representation of a Sonos Battery entity."""
|
||||
|
||||
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique ID of the sensor."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue