Skip to content

Commit

Permalink
Fix issue with fetching serial number (closes #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
dchesterton committed Oct 26, 2021
1 parent 2886e5c commit 594a423
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/amcrest2mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ def signal_handler(sig, frame):
is_ad110 = device_type == "AD110"
is_ad410 = device_type == "AD410"
is_doorbell = is_ad110 or is_ad410
serial_number = camera.serial_number.strip()
serial_number = camera.serial_number

if not isinstance(serial_number, str):
log(f"Error fetching serial number", level="ERROR")
exit_gracefully(1)

sw_version = camera.software_information[0].replace("version=", "").strip()
device_name = camera.machine_name.replace("name=", "").strip()
device_slug = slugify(device_name, separator="_")
Expand Down

0 comments on commit 594a423

Please sign in to comment.