secubox-openwrt/package/secubox/luci-app-zigbee2mqtt/htdocs/luci-static/resources/zigbee2mqtt/api.js
CyberMind-FR c5d40cf464 feat(zigbee2mqtt): Rewrite from Docker to LXC Alpine container
Replace Docker-based zigbee2mqtt with a KISS LXC approach using Alpine
Linux container with Node.js + zigbee2mqtt, matching the HAProxy LXC
pattern. Adds USB serial passthrough for Sonoff Dongle Lite MG21.

- zigbee2mqttctl: Full LXC lifecycle (install, update, check, shell)
- RPCD: LXC diagnostics (lxc, cp210x, serial, container, service)
- api.js: Fix callApply missing params (payload was silently dropped)
- overview.js: Match new LXC diagnostics, fix applyConfig call
- Makefiles: Replace +dockerd +docker +containerd with +lxc +kmod-usb-serial-cp210x

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:32:57 +01:00

55 lines
1004 B
JavaScript

/* global rpc */
'use strict';
'require rpc';
var callStatus = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'status',
expect: { }
});
var callApply = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'apply',
params: ['enabled', 'serial_port', 'mqtt_host', 'mqtt_username', 'mqtt_password',
'base_topic', 'frontend_port', 'channel', 'permit_join', 'data_path']
});
var callLogs = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'logs',
params: ['tail']
});
var callControl = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'control',
params: ['action']
});
var callUpdate = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'update'
});
var callInstall = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'install'
});
var callCheck = rpc.declare({
object: 'luci.zigbee2mqtt',
method: 'check'
});
return {
getStatus: callStatus,
applyConfig: callApply,
getLogs: callLogs,
control: callControl,
update: callUpdate,
install: callInstall,
runCheck: callCheck
};