mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 05:35:11 +02:00
Add entity category
This commit is contained in:
@@ -16,7 +16,7 @@ from homeassistant.components.binary_sensor import (
|
|||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
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.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||||
from homeassistant.helpers import event
|
from homeassistant.helpers import event
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@@ -84,6 +84,7 @@ class JewishCalendarBinarySensor(BinarySensorEntity):
|
|||||||
"""Representation of an Jewish Calendar binary sensor."""
|
"""Representation of an Jewish Calendar binary sensor."""
|
||||||
|
|
||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
|
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
entity_description: JewishCalendarBinarySensorEntityDescription
|
entity_description: JewishCalendarBinarySensorEntityDescription
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@@ -15,7 +15,12 @@ from homeassistant.components.sensor import (
|
|||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
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.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.sun import get_astral_event_date
|
from homeassistant.helpers.sun import get_astral_event_date
|
||||||
@@ -194,6 +199,8 @@ async def async_setup_entry(
|
|||||||
class JewishCalendarSensor(SensorEntity):
|
class JewishCalendarSensor(SensorEntity):
|
||||||
"""Representation of an Jewish calendar sensor."""
|
"""Representation of an Jewish calendar sensor."""
|
||||||
|
|
||||||
|
_attr_entity_category = EntityCategory.DIAGNOSTIC
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
entry_id: str,
|
entry_id: str,
|
||||||
|
Reference in New Issue
Block a user