Implement optional External trigger for ZoneMinder switch#6836
Conversation
There was a problem hiding this comment.
indentation is not a multiple of four
There was a problem hiding this comment.
continuation line missing indentation or outdented
There was a problem hiding this comment.
continuation line missing indentation or outdented
There was a problem hiding this comment.
continuation line unaligned for hanging indent
There was a problem hiding this comment.
continuation line unaligned for hanging indent
There was a problem hiding this comment.
continuation line unaligned for hanging indent
There was a problem hiding this comment.
continuation line over-indented for visual indent
There was a problem hiding this comment.
continuation line over-indented for visual indent
There was a problem hiding this comment.
line too long (84 > 79 characters)
Currently ZoneMinder switch allows triggering recording by switching monitor state. Unfortunately changing monitor state over web API seem to be really slow, because some cameras require long warm-up periods. As result if you get substantial delay and might even miss an event that was associated with the trigger. Fortunately ZM provides 'Nodect' monitor mode where camera is kept warm and it can start recording immediately. This way you will have a chance to see how your S.W.A.T team actually captures the imaginary invader approaching your nuclear facility monitored by homeassistant+zoneminder. Signed-off-by: Andrey Petrov <andrey.petrov@gmail.com>
| PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ | ||
| vol.Required(CONF_COMMAND_ON): cv.string, | ||
| vol.Required(CONF_COMMAND_OFF): cv.string, | ||
| vol.Optional('ext_trigger_time', default=60): cv.time, |
| vol.Required(CONF_HOST): cv.string, | ||
| vol.Optional(CONF_SSL, default=DEFAULT_SSL): cv.boolean, | ||
| vol.Optional(CONF_PATH, default=DEFAULT_PATH): cv.string, | ||
| vol.Optional('trigger_port', default=DEFAULT_TRIGGER_PORT): cv.port, |
| import socket | ||
| sock = socket.socket() | ||
| try: | ||
| sock.connect((ZM['host'], ZM['trigger_port'])) |
There was a problem hiding this comment.
This is crossing the boundary of protocol specific code that is allowed to be in Home Assistant. Please extract the Zoneminder logic into it's own Python library.
There was a problem hiding this comment.
do you mean to shove all that into PyPi package?
|
Noticed your docs pr already got merged. I reverted it and have updated the link in your PR description to point at the new docs PR: home-assistant/home-assistant.io#2360 |
|
This PR seems to have gone stale. Closing it. You can reopen it when you're ready to finish it. |
Currently ZoneMinder switch allows triggering recording by switching
monitor state. Unfortunately changing monitor state over web API seem
to be really slow, because some cameras require long warm-up periods.
As result if you get substantial delay and might even miss an event
that was associated with the trigger. Fortunately ZM provides 'Nodect'
monitor mode where camera is kept warm and it can start recording
immediately. This way you will have a chance to see how your S.W.A.T
team actually captures the imaginary invader approaching your nuclear
facility monitored by homeassistant+zoneminder.
Signed-off-by: Andrey Petrov andrey.petrov@gmail.com
Description:
Pull request in home-assistant.github.io with documentation:
home-assistant/home-assistant.io#2350home-assistant/home-assistant.io#2360Example entry for
configuration.yaml(if applicable):<see documentation PR>Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass