Skip to content

fix-low: name each pre-1.37 mode as ZoneMinder does - #61

Merged
SteveGilvarry merged 1 commit into
ZoneMinder:mainfrom
nabbi:fix/function-names
Oct 25, 2026
Merged

SteveGilvarry merged 1 commit into
ZoneMinder:mainfrom
nabbi:fix/function-names

Conversation

@nabbi

@nabbi nabbi commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Impact: low (Monitor.function names Modect monitors "Mocord", Nodect "Record"; shown by zm-homeassistant's Mode sensor)

Automated PR, tested in a zm-holodeck sandbox. An AI agent (Claude Opus 5.5) wrote this against a disposable
lab (ZoneMinder upstream master 1bdccda40 with its CakePHP API v2; simulated HikVision, Dahua, Axis, Reolink and
ONVIF cameras) and ran the checks there. Minimal human review before opening: please review it as you would any
contributor's PR.

TL;DR

  • Fixes: Monitor.function calls Modect "Mocord" (and Nodect "Record") #60 (Monitor.function calls Always/Always/OnMotion "Mocord" and Always/None/OnMotion "Record")
  • Change: _derive_function looks the fields up in the inverse of function_fields' table first, so the six pre-1.37 modes get ZoneMinder's names; other combinations keep the nearest name. Tests and changelog line; 3 files, +37 −3
  • Risk: Monitor.function changes for Modect and Nodect monitors only; nothing in the library reads it
  • Tested: 5 unit cases fail before, pass after; full unit suite, ruff, ruff format, mypy pass. Live API v2 results: see Monitor.function calls Modect "Mocord" (and Nodect "Record") #60.

Fixes #60

🤖 Generated with Claude Code

Monitor.function called Modect (capturing Always, analysing Always,
recording OnMotion) "Mocord", Nodect (Always/None/OnMotion) "Record", and
Always/Always/None "Modect". ZoneMinder's own mapping (zm_update-1.37.12.sql,
and function_fields here) has Modect = Always/Always/OnMotion and Mocord =
Always/Always/Always, so a monitor set to Modect with function_fields read
back as Mocord, and a 1.36 monitor whose Function is Modect did too.

The six combinations function_fields returns now get their own names;
any other combination keeps the nearest name, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SteveGilvarry
SteveGilvarry merged commit 00ed3f9 into ZoneMinder:main Oct 25, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitor.function calls Modect "Mocord" (and Nodect "Record")

2 participants