Skip to content

Commit

Permalink
Properly handle unavailable port value writes
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Feb 22, 2023
1 parent 44b4b28 commit b617fdd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qtoggleserver/paradox/area.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from abc import ABCMeta
from typing import Optional

from qtoggleserver.core import ports as core_ports

from . import constants
from .paradoxport import ParadoxPort
from .typing import Property
Expand Down Expand Up @@ -113,6 +115,7 @@ async def read_value(self) -> Optional[int]:
else:
return self._ARMED_STATE_MAPPING[current_state]

@core_ports.skip_write_unavailable
async def write_value(self, value: int) -> None:
self._requested_value = value
await self.get_peripheral().set_area_armed_mode(self.area, self._ARMED_MODE_MAPPING[abs(value)])
Expand Down

0 comments on commit b617fdd

Please sign in to comment.