Update pypoint to use async http requests (#41546)
* Remove domain after entities * Add support for async http-requests * Fix, handle network issues (update _is_available status) * Fix missing await for alarm_arm * Fix alarm status * Update tests to async * Bump pypoint version * Fix doc string * Apply suggestions from code review, remove pylint disable * Fix black
This commit is contained in:
parent
32204821c1
commit
8bdc824b6c
8 changed files with 49 additions and 46 deletions
|
@ -99,15 +99,15 @@ class MinutPointAlarmControl(AlarmControlPanelEntity):
|
|||
"""Return the user the last change was triggered by."""
|
||||
return self._changed_by
|
||||
|
||||
def alarm_disarm(self, code=None):
|
||||
async def async_alarm_disarm(self, code=None):
|
||||
"""Send disarm command."""
|
||||
status = self._client.alarm_disarm(self._home_id)
|
||||
status = await self._client.async_alarm_disarm(self._home_id)
|
||||
if status:
|
||||
self._home["alarm_status"] = "off"
|
||||
|
||||
def alarm_arm_away(self, code=None):
|
||||
async def async_alarm_arm_away(self, code=None):
|
||||
"""Send arm away command."""
|
||||
status = self._client.alarm_arm(self._home_id)
|
||||
status = await self._client.async_alarm_arm(self._home_id)
|
||||
if status:
|
||||
self._home["alarm_status"] = "on"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue