Fix arlo platform schema (#54470)
parent
028a3d3e53
commit
6f70302901
|
@ -1,4 +1,6 @@
|
|||
"""Sensor support for Netgear Arlo IP cameras."""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import replace
|
||||
import logging
|
||||
|
||||
|
@ -28,11 +30,21 @@ from . import ATTRIBUTION, DATA_ARLO, DEFAULT_BRAND, SIGNAL_UPDATE_ARLO
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SENSOR_TYPES = (
|
||||
SensorEntityDescription(key="last_capture", name="Last", icon="mdi:run-fast"),
|
||||
SensorEntityDescription(key="total_cameras", name="Arlo Cameras", icon="mdi:video"),
|
||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="captured_today", name="Captured Today", icon="mdi:file-video"
|
||||
key="last_capture",
|
||||
name="Last",
|
||||
icon="mdi:run-fast",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="total_cameras",
|
||||
name="Arlo Cameras",
|
||||
icon="mdi:video",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="captured_today",
|
||||
name="Captured Today",
|
||||
icon="mdi:file-video",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="battery_level",
|
||||
|
@ -41,7 +53,9 @@ SENSOR_TYPES = (
|
|||
device_class=DEVICE_CLASS_BATTERY,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="signal_strength", name="Signal Strength", icon="mdi:signal"
|
||||
key="signal_strength",
|
||||
name="Signal Strength",
|
||||
icon="mdi:signal",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="temperature",
|
||||
|
@ -63,10 +77,12 @@ SENSOR_TYPES = (
|
|||
),
|
||||
)
|
||||
|
||||
SENSOR_KEYS = [desc.key for desc in SENSOR_TYPES]
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
vol.Required(CONF_MONITORED_CONDITIONS, default=list(SENSOR_TYPES)): vol.All(
|
||||
cv.ensure_list, [vol.In(SENSOR_TYPES)]
|
||||
vol.Required(CONF_MONITORED_CONDITIONS, default=SENSOR_KEYS): vol.All(
|
||||
cv.ensure_list, [vol.In(SENSOR_KEYS)]
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue