Clean up logi circle const (#95540)
parent
d935c18f38
commit
4fa9f25e38
|
@ -35,11 +35,11 @@ from .const import (
|
|||
DOMAIN,
|
||||
LED_MODE_KEY,
|
||||
RECORDING_MODE_KEY,
|
||||
SENSOR_TYPES,
|
||||
SIGNAL_LOGI_CIRCLE_RECONFIGURE,
|
||||
SIGNAL_LOGI_CIRCLE_RECORD,
|
||||
SIGNAL_LOGI_CIRCLE_SNAPSHOT,
|
||||
)
|
||||
from .sensor import SENSOR_TYPES
|
||||
|
||||
NOTIFICATION_ID = "logi_circle_notification"
|
||||
NOTIFICATION_TITLE = "Logi Circle Setup"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
"""Constants in Logi Circle component."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntityDescription
|
||||
from homeassistant.const import PERCENTAGE
|
||||
|
||||
DOMAIN = "logi_circle"
|
||||
DATA_LOGI = DOMAIN
|
||||
|
||||
|
@ -15,41 +12,6 @@ DEFAULT_CACHEDB = ".logi_cache.pickle"
|
|||
LED_MODE_KEY = "LED"
|
||||
RECORDING_MODE_KEY = "RECORDING_MODE"
|
||||
|
||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="battery_level",
|
||||
name="Battery",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:battery-50",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="last_activity_time",
|
||||
name="Last Activity",
|
||||
icon="mdi:history",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="recording",
|
||||
name="Recording Mode",
|
||||
icon="mdi:eye",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="signal_strength_category",
|
||||
name="WiFi Signal Category",
|
||||
icon="mdi:wifi",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="signal_strength_percentage",
|
||||
name="WiFi Signal Strength",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:wifi",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="streaming",
|
||||
name="Streaming Mode",
|
||||
icon="mdi:camera",
|
||||
),
|
||||
)
|
||||
|
||||
SIGNAL_LOGI_CIRCLE_RECONFIGURE = "logi_circle_reconfigure"
|
||||
SIGNAL_LOGI_CIRCLE_SNAPSHOT = "logi_circle_snapshot"
|
||||
SIGNAL_LOGI_CIRCLE_RECORD = "logi_circle_record"
|
||||
|
|
|
@ -10,6 +10,7 @@ from homeassistant.const import (
|
|||
ATTR_BATTERY_CHARGING,
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
CONF_SENSORS,
|
||||
PERCENTAGE,
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
)
|
||||
|
@ -20,11 +21,47 @@ from homeassistant.helpers.icon import icon_for_battery_level
|
|||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
from homeassistant.util.dt import as_local
|
||||
|
||||
from .const import ATTRIBUTION, DEVICE_BRAND, DOMAIN as LOGI_CIRCLE_DOMAIN, SENSOR_TYPES
|
||||
from .const import ATTRIBUTION, DEVICE_BRAND, DOMAIN as LOGI_CIRCLE_DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="battery_level",
|
||||
name="Battery",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:battery-50",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="last_activity_time",
|
||||
name="Last Activity",
|
||||
icon="mdi:history",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="recording",
|
||||
name="Recording Mode",
|
||||
icon="mdi:eye",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="signal_strength_category",
|
||||
name="WiFi Signal Category",
|
||||
icon="mdi:wifi",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="signal_strength_percentage",
|
||||
name="WiFi Signal Strength",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:wifi",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="streaming",
|
||||
name="Streaming Mode",
|
||||
icon="mdi:camera",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
|
|
Loading…
Reference in New Issue