mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Add entity category
This commit is contained in:
@@ -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__(
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user