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