Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display mixin fixes #49

Merged
merged 2 commits into from
Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions reolinkapi/mixins/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_mask(self) -> Dict:

def set_osd(self, bg_color: bool = 0, channel: float = 0, osd_channel_enabled: bool = 0,
osd_channel_name: str = "", osd_channel_pos: str = "Lower Right", osd_time_enabled: bool = 0,
osd_time_pos: str = "Lower Right") -> bool:
osd_time_pos: str = "Lower Right", osd_watermark_enabled: bool = 0) -> bool:
"""
Set OSD
:param bg_color: bool
Expand All @@ -47,10 +47,11 @@ def set_osd(self, bg_color: bool = 0, channel: float = 0, osd_channel_enabled: b
"enable": osd_channel_enabled, "name": osd_channel_name,
"pos": osd_channel_pos
},
"osdTime": {"enable": osd_time_enabled, "pos": osd_time_pos}
"osdTime": {"enable": osd_time_enabled, "pos": osd_time_pos},
"watermark": osd_watermark_enabled,
}}}]
r_data = self._execute_command('SetOsd', body)[0]
if r_data["value"]["rspCode"] == 200:
if 'value' in r_data and r_data["value"]["rspCode"] == 200:
return True
print("Could not set OSD. Camera responded with status:", r_data["value"])
print("Could not set OSD. Camera responded with status:", r_data["error"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this then not be the case for every mixin since they all reference the error with the "value" key?
Maybe this was recently added in a camera firmware update?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. Haven't dove that far in. Just addressed here since that's where the handling was already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this then not be the case for every mixin since they all reference the error with the "value" key?
Maybe this was recently added in a camera firmware update?

Yes, it would.

return False