Add entity category

This commit is contained in:
Tsvi Mostovicz
2024-06-23 11:55:07 +00:00
parent 7f54947b95
commit 991dfd283b
2 changed files with 10 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_LANGUAGE, CONF_LOCATION
from homeassistant.const import CONF_LANGUAGE, CONF_LOCATION, EntityCategory
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers import event
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -84,6 +84,7 @@ class JewishCalendarBinarySensor(BinarySensorEntity):
"""Representation of an Jewish Calendar binary sensor."""
_attr_should_poll = False
_attr_entity_category = EntityCategory.DIAGNOSTIC
entity_description: JewishCalendarBinarySensorEntityDescription
def __init__(

View File

@@ -15,7 +15,12 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_LANGUAGE, CONF_LOCATION, SUN_EVENT_SUNSET
from homeassistant.const import (
CONF_LANGUAGE,
CONF_LOCATION,
SUN_EVENT_SUNSET,
EntityCategory,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.sun import get_astral_event_date
@@ -194,6 +199,8 @@ async def async_setup_entry(
class JewishCalendarSensor(SensorEntity):
"""Representation of an Jewish calendar sensor."""
_attr_entity_category = EntityCategory.DIAGNOSTIC
def __init__(
self,
entry_id: str,