Skip to content

Commit

Permalink
revert this catch it wsn't right
Browse files Browse the repository at this point in the history
Signed-off-by: Nic Boet <[email protected]>
  • Loading branch information
nabbi committed Nov 16, 2024
1 parent 454056c commit 8b0c3ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "zm-py"
version = "0.5.5.dev3"
version = "0.5.5.dev4"
description = "A loose python wrapper around the ZoneMinder REST API."
authors = ["Rohan Kapoor <[email protected]>"]
maintainers = ["Nic Boet <[email protected]>"]
Expand Down
11 changes: 4 additions & 7 deletions zoneminder/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,14 @@ def name(self) -> str:
def update_monitor(self):
"""Update the monitor and monitor status from the ZM server."""
result = self._client.get_state(self._monitor_url)
try:
self._raw_result = result["monitor"]
except KeyError:
return False
self._raw_result = result["monitor"]

@property
def function(self) -> MonitorState:
"""Get the MonitorState of this Monitor."""
if self.update_monitor():
return MonitorState(self._raw_result["Monitor"]["Function"])
return "Error-MonitorState"
self.update_monitor()

return MonitorState(self._raw_result["Monitor"]["Function"])

@function.setter
def function(self, new_function):
Expand Down

0 comments on commit 8b0c3ae

Please sign in to comment.