mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Adjust setup type hints in agent_dvr (#72224)
This commit is contained in:
parent
74e8b076e5
commit
a72ce2415b
@ -3,13 +3,16 @@ from homeassistant.components.alarm_control_panel import (
|
|||||||
AlarmControlPanelEntity,
|
AlarmControlPanelEntity,
|
||||||
AlarmControlPanelEntityFeature,
|
AlarmControlPanelEntityFeature,
|
||||||
)
|
)
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ALARM_ARMED_AWAY,
|
STATE_ALARM_ARMED_AWAY,
|
||||||
STATE_ALARM_ARMED_HOME,
|
STATE_ALARM_ARMED_HOME,
|
||||||
STATE_ALARM_ARMED_NIGHT,
|
STATE_ALARM_ARMED_NIGHT,
|
||||||
STATE_ALARM_DISARMED,
|
STATE_ALARM_DISARMED,
|
||||||
)
|
)
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import CONNECTION, DOMAIN as AGENT_DOMAIN
|
from .const import CONNECTION, DOMAIN as AGENT_DOMAIN
|
||||||
|
|
||||||
@ -23,8 +26,10 @@ CONST_ALARM_CONTROL_PANEL_NAME = "Alarm Panel"
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass, config_entry, async_add_entities, discovery_info=None
|
hass: HomeAssistant,
|
||||||
):
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the Agent DVR Alarm Control Panels."""
|
"""Set up the Agent DVR Alarm Control Panels."""
|
||||||
async_add_entities(
|
async_add_entities(
|
||||||
[AgentBaseStation(hass.data[AGENT_DOMAIN][config_entry.entry_id][CONNECTION])]
|
[AgentBaseStation(hass.data[AGENT_DOMAIN][config_entry.entry_id][CONNECTION])]
|
||||||
|
@ -6,9 +6,14 @@ from agent import AgentError
|
|||||||
|
|
||||||
from homeassistant.components.camera import CameraEntityFeature
|
from homeassistant.components.camera import CameraEntityFeature
|
||||||
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
|
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION
|
from homeassistant.const import ATTR_ATTRIBUTION
|
||||||
from homeassistant.helpers import entity_platform
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import (
|
||||||
|
AddEntitiesCallback,
|
||||||
|
async_get_current_platform,
|
||||||
|
)
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTRIBUTION,
|
ATTRIBUTION,
|
||||||
@ -37,8 +42,10 @@ CAMERA_SERVICES = {
|
|||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass, config_entry, async_add_entities, discovery_info=None
|
hass: HomeAssistant,
|
||||||
):
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
|
) -> None:
|
||||||
"""Set up the Agent cameras."""
|
"""Set up the Agent cameras."""
|
||||||
filter_urllib3_logging()
|
filter_urllib3_logging()
|
||||||
cameras = []
|
cameras = []
|
||||||
@ -55,7 +62,7 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
async_add_entities(cameras)
|
async_add_entities(cameras)
|
||||||
|
|
||||||
platform = entity_platform.async_get_current_platform()
|
platform = async_get_current_platform()
|
||||||
for service, method in CAMERA_SERVICES.items():
|
for service, method in CAMERA_SERVICES.items():
|
||||||
platform.async_register_entity_service(service, {}, method)
|
platform.async_register_entity_service(service, {}, method)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user