Skip to content

Commit

Permalink
Merge pull request #59 from rohankapoorcom/nabbi
Browse files Browse the repository at this point in the history
Ver bump, add key check, readme
  • Loading branch information
nabbi committed Jan 8, 2024
2 parents 3f66921 + e6a03ef commit ab0360c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ PASS = "{{pass}}"
SERVER_PATH = "{{path}}"

zm_client = ZoneMinder(
server_host=SERVER_HOST, server_path=SERVER_PATH, username=USER, password=PASS, verify_ssl=False
server_host=SERVER_HOST,
server_path=SERVER_PATH,
username=USER,
password=PASS,
verify_ssl=False
)

#Zoneminder authentication
# Zoneminder authentication
zm_client.login()


#Get all monitors
# Get all monitors
monitors = zm_client.get_monitors()

for monitor in monitors:
Expand All @@ -59,7 +63,7 @@ for monitor in monitors:
>>> Monitor(id='monitor_id', name='monitor_name', controllable='is_controllable')


#Move camera down
# Move camera down
controllable_monitors = [m for m in monitors if m.controllable]

for monitor in controllable_monitors:
Expand Down
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.3"
version = "0.5.4"
description = "A loose python wrapper around the ZoneMinder REST API."
authors = ["Rohan Kapoor <rohan@rohankapoor.com>"]
maintainers = ["Nic Boet <nic@boet.cc>"]
Expand Down
4 changes: 4 additions & 0 deletions zoneminder/zm.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ def get_monitors(self) -> List[Monitor]:
_LOGGER.warning("Could not fetch monitors from ZoneMinder")
return []

if "monitors" not in raw_monitors:
_LOGGER.warning("Could not parse list of monitors from ZoneMinder")
return []

monitors = []
for raw_result in raw_monitors["monitors"]:
_LOGGER.debug("Initializing camera %s", raw_result["Monitor"]["Id"])
Expand Down

0 comments on commit ab0360c

Please sign in to comment.