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

IO events v2 #91

Merged
merged 4 commits into from
Jul 8, 2023
Merged

IO events v2 #91

merged 4 commits into from
Jul 8, 2023

Conversation

msp1974
Copy link
Contributor

@msp1974 msp1974 commented Jul 8, 2023

@maciej-or , apologies, I hadn't realised you merged the last PR. I was going to add to it - should have probably pulled it or at least made that clear.

This is an improved version of IO support that fits much better in the general method of event management without using different binary sensors or switches. It will also allow simple adding of other NVR/Single camera event management going forward.

Other enhancements

  1. Added connection type to camera object (direct or proxied)
  2. Used this connection type instead of looking for whether NVR or single camera and whether analog or IP. Simplifies some of the functions greatly. Single IP camera or NVR analog camera are all direct, IP camera via NVR are proxied. This fits with the ISAPI API path logic.
  3. Added a couple of event definition options to support different node keys depending on whether direct or proxied camera (you will see in the IO event definition in const.py) Note: I haven't looked at whether this should be applied to other definitions yet. It may or not make sense to simplify some of the isapi functions.
  4. Added a get_event_state_node funtion to utilise these 2 new event definition keys and return correct node to query. Used this in existing functions (get/set event enabled state) to simplify down.
  5. This now supports Input events via NVR, single IP camera and (should support but not able to test) IP Camera on NVR
  6. I have also added more items and ensured the raw outputs are full outputs in the diagnostics download to help with compatibility issues.

Outstanding To Do:

  1. It only supports output ports on NVR or single IP cam (direct connect devices). Need to work more on how this works for proxied cameras. However, this maybe better as another PR.

@maciej-or
Copy link
Owner

Excellent! Add the rest cameras support in next one. I prefer smaller PRs.

@maciej-or maciej-or merged commit 8de9131 into maciej-or:main Jul 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants