Adjust type hints in prosegur alarm (#74093)
* Adjust type hints in prosegur alarm * Adjust hintpull/72830/head^2
parent
8e1ec07f3d
commit
f66acf293f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue