mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-08 13:43:04 -05:00
Add a CanIndicatorLight capability and status-aware Indicator toggle button. The indicator LED on the ASH21-B, ADC2W and ASH42-B is controlled via the LightGlobal config (configManager get/setConfig); add indicatorLightOn/Off/Status to Dahua_RPC and a model-specific 'Amcrest ASH42-B RPC' Controls row, with the capability also enabled on the ASH21-B/ADC2W/generic rows. Migration zm_update-1.39.13.sql adds the column. Add Dahua_RPC keepAlive (global.keepAlive) wired into a 30s zmcontrol idle tick, plus session-expiry re-login retry in set_config and the status queries, so the long-running control daemon does not silently fail after the ~60s session timeout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
1.5 KiB
SQL
40 lines
1.5 KiB
SQL
--
|
|
-- Add CanIndicatorLight capability column to Controls (camera indicator LED on/off).
|
|
--
|
|
SET @s = (SELECT IF(
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE table_schema = DATABASE()
|
|
AND table_name = 'Controls'
|
|
AND column_name = 'CanIndicatorLight') > 0,
|
|
'SELECT ''Column CanIndicatorLight already exists''',
|
|
'ALTER TABLE `Controls` ADD COLUMN `CanIndicatorLight` tinyint(3) unsigned NOT NULL default ''0'' AFTER `CanLight`'
|
|
));
|
|
PREPARE stmt FROM @s;
|
|
EXECUTE stmt;
|
|
DEALLOCATE PREPARE stmt;
|
|
|
|
--
|
|
-- Add model-specific Controls entry for the Amcrest ASH42-B.
|
|
-- This model has no PTZ; its indicator LED is controlled via LightGlobal config
|
|
-- (configManager.setConfig/getConfig, verified live). Reboot via magicBox.reboot.
|
|
--
|
|
INSERT INTO `Controls`
|
|
(`Name`,`Type`,`Protocol`,`CanReset`,`CanReboot`,`CanIndicatorLight`)
|
|
SELECT 'Amcrest ASH42-B RPC','Ffmpeg','Dahua_RPC',1,1,1
|
|
FROM DUAL
|
|
WHERE NOT EXISTS (SELECT 1 FROM `Controls` WHERE `Name`='Amcrest ASH42-B RPC');
|
|
|
|
--
|
|
-- The ASH21-B and ADC2W also control their indicator LED via LightGlobal
|
|
-- (verified live on both models), so enable the capability on their entries.
|
|
--
|
|
UPDATE `Controls` SET `CanIndicatorLight`=1
|
|
WHERE `Name` IN ('Amcrest ASH21-B RPC','Amcrest ADC2W RPC');
|
|
|
|
--
|
|
-- The generic entry keeps every capability enabled for testing new cameras.
|
|
-- (CanLight column was added by 1.39.12, CanIndicatorLight above.)
|
|
--
|
|
UPDATE `Controls` SET `CanLight`=1, `CanIndicatorLight`=1
|
|
WHERE `Name`='Dahua/Amcrest RPC';
|