Adjust type hints in component alarm methods (#74092)

* Adjust type hints in component alarm methods

* Undo related change

* Undo related change
This commit is contained in:
epenet 2022-06-28 10:00:23 +02:00 committed by GitHub
parent 800bae68a8
commit 8e1ec07f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 125 additions and 107 deletions

View file

@ -121,7 +121,7 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
_LOGGER.debug("Setting up alarm: %s", alarm_name)
super().__init__(alarm_name, info, controller)
async def async_added_to_hass(self):
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
self.async_on_remove(
async_dispatcher_connect(
@ -168,7 +168,7 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
state = STATE_ALARM_DISARMED
return state
async def async_alarm_disarm(self, code=None):
async def async_alarm_disarm(self, code: str | None = None) -> None:
"""Send disarm command."""
if code:
self.hass.data[DATA_EVL].disarm_partition(str(code), self._partition_number)
@ -177,7 +177,7 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
str(self._code), self._partition_number
)
async def async_alarm_arm_home(self, code=None):
async def async_alarm_arm_home(self, code: str | None = None) -> None:
"""Send arm home command."""
if code:
self.hass.data[DATA_EVL].arm_stay_partition(
@ -188,7 +188,7 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
str(self._code), self._partition_number
)
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."""
if code:
self.hass.data[DATA_EVL].arm_away_partition(
@ -199,11 +199,11 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
str(self._code), self._partition_number
)
async def async_alarm_trigger(self, code=None):
async def async_alarm_trigger(self, code: str | None = None) -> None:
"""Alarm trigger command. Will be used to trigger a panic alarm."""
self.hass.data[DATA_EVL].panic_alarm(self._panic_type)
async def async_alarm_arm_night(self, code=None):
async def async_alarm_arm_night(self, code: str | None = None) -> None:
"""Send arm night command."""
self.hass.data[DATA_EVL].arm_night_partition(
str(code) if code else str(self._code), self._partition_number