mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Clean up logi circle const (#95540)
This commit is contained in:
parent
d935c18f38
commit
4fa9f25e38
@ -35,11 +35,11 @@ from .const import (
|
|||||||
DOMAIN,
|
DOMAIN,
|
||||||
LED_MODE_KEY,
|
LED_MODE_KEY,
|
||||||
RECORDING_MODE_KEY,
|
RECORDING_MODE_KEY,
|
||||||
SENSOR_TYPES,
|
|
||||||
SIGNAL_LOGI_CIRCLE_RECONFIGURE,
|
SIGNAL_LOGI_CIRCLE_RECONFIGURE,
|
||||||
SIGNAL_LOGI_CIRCLE_RECORD,
|
SIGNAL_LOGI_CIRCLE_RECORD,
|
||||||
SIGNAL_LOGI_CIRCLE_SNAPSHOT,
|
SIGNAL_LOGI_CIRCLE_SNAPSHOT,
|
||||||
)
|
)
|
||||||
|
from .sensor import SENSOR_TYPES
|
||||||
|
|
||||||
NOTIFICATION_ID = "logi_circle_notification"
|
NOTIFICATION_ID = "logi_circle_notification"
|
||||||
NOTIFICATION_TITLE = "Logi Circle Setup"
|
NOTIFICATION_TITLE = "Logi Circle Setup"
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
"""Constants in Logi Circle component."""
|
"""Constants in Logi Circle component."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntityDescription
|
|
||||||
from homeassistant.const import PERCENTAGE
|
|
||||||
|
|
||||||
DOMAIN = "logi_circle"
|
DOMAIN = "logi_circle"
|
||||||
DATA_LOGI = DOMAIN
|
DATA_LOGI = DOMAIN
|
||||||
|
|
||||||
@ -15,41 +12,6 @@ DEFAULT_CACHEDB = ".logi_cache.pickle"
|
|||||||
LED_MODE_KEY = "LED"
|
LED_MODE_KEY = "LED"
|
||||||
RECORDING_MODE_KEY = "RECORDING_MODE"
|
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_RECONFIGURE = "logi_circle_reconfigure"
|
||||||
SIGNAL_LOGI_CIRCLE_SNAPSHOT = "logi_circle_snapshot"
|
SIGNAL_LOGI_CIRCLE_SNAPSHOT = "logi_circle_snapshot"
|
||||||
SIGNAL_LOGI_CIRCLE_RECORD = "logi_circle_record"
|
SIGNAL_LOGI_CIRCLE_RECORD = "logi_circle_record"
|
||||||
|
@ -10,6 +10,7 @@ from homeassistant.const import (
|
|||||||
ATTR_BATTERY_CHARGING,
|
ATTR_BATTERY_CHARGING,
|
||||||
CONF_MONITORED_CONDITIONS,
|
CONF_MONITORED_CONDITIONS,
|
||||||
CONF_SENSORS,
|
CONF_SENSORS,
|
||||||
|
PERCENTAGE,
|
||||||
STATE_OFF,
|
STATE_OFF,
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
)
|
)
|
||||||
@ -20,11 +21,47 @@ from homeassistant.helpers.icon import icon_for_battery_level
|
|||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util.dt import as_local
|
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__)
|
_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(
|
async def async_setup_platform(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: ConfigType,
|
config: ConfigType,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user