Add entity category to MotionEye (#58370)

pull/58403/head
Simone Chemelli 2021-10-25 12:44:03 +02:00 committed by GitHub
parent a36ac11d57
commit 6d5dd3ee77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 3 deletions

View File

@ -18,6 +18,7 @@ from motioneye_client.const import (
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import ENTITY_CATEGORY_CONFIG
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -29,25 +30,37 @@ MOTIONEYE_SWITCHES = [
key=KEY_MOTION_DETECTION,
name="Motion Detection",
entity_registry_enabled_default=True,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SwitchEntityDescription(
key=KEY_TEXT_OVERLAY, name="Text Overlay", entity_registry_enabled_default=False
key=KEY_TEXT_OVERLAY,
name="Text Overlay",
entity_registry_enabled_default=False,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SwitchEntityDescription(
key=KEY_VIDEO_STREAMING,
name="Video Streaming",
entity_registry_enabled_default=False,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SwitchEntityDescription(
key=KEY_STILL_IMAGES, name="Still Images", entity_registry_enabled_default=True
key=KEY_STILL_IMAGES,
name="Still Images",
entity_registry_enabled_default=True,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SwitchEntityDescription(
key=KEY_MOVIES, name="Movies", entity_registry_enabled_default=True
key=KEY_MOVIES,
name="Movies",
entity_registry_enabled_default=True,
entity_category=ENTITY_CATEGORY_CONFIG,
),
SwitchEntityDescription(
key=KEY_UPLOAD_ENABLED,
name="Upload Enabled",
entity_registry_enabled_default=False,
entity_category=ENTITY_CATEGORY_CONFIG,
),
]