Fix arm/disarm calls. (#17381)

This commit is contained in:
Martin Berg authored and Paulus Schoutsen committed 2018-10-15 15:30:19 +02:00
1 parent 49a9b61f6f
commit 220054a6c3
1 file changed
+8 -4
@@ -85,19 +85,23 @@ class SpcAlarm(alarm.AlarmControlPanel):
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
from pyspcwebgw.const import AreaMode
self._api.change_mode(area=self._area, new_mode=AreaMode.UNSET)
await self._api.change_mode(area=self._area,
new_mode=AreaMode.UNSET)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
from pyspcwebgw.const import AreaMode
self._api.change_mode(area=self._area, new_mode=AreaMode.PART_SET_A)
await self._api.change_mode(area=self._area,
new_mode=AreaMode.PART_SET_A)
async def async_alarm_arm_night(self, code=None):
"""Send arm home command."""
from pyspcwebgw.const import AreaMode
self._api.change_mode(area=self._area, new_mode=AreaMode.PART_SET_B)
await self._api.change_mode(area=self._area,
new_mode=AreaMode.PART_SET_B)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
from pyspcwebgw.const import AreaMode
self._api.change_mode(area=self._area, new_mode=AreaMode.FULL_SET)
await self._api.change_mode(area=self._area,
new_mode=AreaMode.FULL_SET)