From f66acf293f080017a784c98523e59c3a5f10d190 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 28 Jun 2022 10:02:16 +0200 Subject: [PATCH] Adjust type hints in prosegur alarm (#74093) * Adjust type hints in prosegur alarm * Adjust hint --- .../components/prosegur/alarm_control_panel.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/prosegur/alarm_control_panel.py b/homeassistant/components/prosegur/alarm_control_panel.py index e7176b241e5..133c182e2cc 100644 --- a/homeassistant/components/prosegur/alarm_control_panel.py +++ b/homeassistant/components/prosegur/alarm_control_panel.py @@ -1,4 +1,6 @@ """Support for Prosegur alarm control panels.""" +from __future__ import annotations + import logging from pyprosegur.auth import Auth @@ -44,12 +46,12 @@ class ProsegurAlarm(alarm.AlarmControlPanelEntity): AlarmControlPanelEntityFeature.ARM_AWAY | AlarmControlPanelEntityFeature.ARM_HOME ) + _installation: Installation def __init__(self, contract: str, auth: Auth) -> None: """Initialize the Prosegur alarm panel.""" self._changed_by = None - self._installation = None self.contract = contract self._auth = auth @@ -57,7 +59,7 @@ class ProsegurAlarm(alarm.AlarmControlPanelEntity): self._attr_name = f"contract {self.contract}" self._attr_unique_id = self.contract - async def async_update(self): + async def async_update(self) -> None: """Update alarm status.""" try: @@ -70,14 +72,14 @@ class ProsegurAlarm(alarm.AlarmControlPanelEntity): self._attr_state = STATE_MAPPING.get(self._installation.status) self._attr_available = True - async def async_alarm_disarm(self, code=None): + async def async_alarm_disarm(self, code: str | None = None) -> None: """Send disarm command.""" await self._installation.disarm(self._auth) - async def async_alarm_arm_home(self, code=None): + async def async_alarm_arm_home(self, code: str | None = None) -> None: """Send arm away command.""" await self._installation.arm_partially(self._auth) - async def async_alarm_arm_away(self, code=None): + async def async_alarm_arm_away(self, code: str | None = None) -> None: """Send arm away command.""" await self._installation.arm(self._auth)