You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.2 KiB
Lua

--[[
LuCI - Lua Configuration Interface
]]--
local taskd = require "luci.model.tasks"
local frigate_model = require "luci.model.frigate"
local m, s, o
m = taskd.docker_map("frigate", "frigate", "/usr/libexec/apps/frigate/frigate.sh",
translate("Frigate NVR"),
translate("Frigate is an open-source NVR built around real-time AI object detection. All processing is performed locally on your own hardware.")
.. "<br/>".. translate("Official website:") .. ' <a href=\"https://frigate.video/\" target=\"_blank\">https://frigate.video/</a>')
s = m:section(SimpleSection, translate("Container Status"))
s:append(Template("frigate/status"))
-- General Frigate Docker setup
s = m:section(NamedSection, "docker", "frigate_config", "Docker Configuration")
s.addremove = false
s.anonymous = true
o = s:option(Value, "port", "Port")
o.default = "5000"
o = s:option(Value, "image", "Image")
o.default = "ghcr.io/blakeblackshear/frigate:stable"
o = s:option(Value, "usbcoral", "USB Coral")
o.default = "/dev/bus/usb"
o = s:option(Value, "hwaccel", "Hardware Acceleration")
o.default = "/dev/crypto"
o = s:option(Value, "storage", "Storage Path")
o.default = "./frigate/storage"
-- MQTT Configuration
s = m:section(NamedSection, "mqtt", "frigate_config", "MQTT Configuration")
s.addremove = false
s.anonymous = true
o = s:option(Flag, "mqtt", "Enable MQTT")
o.default = "0"
o = s:option(Value, "host", "MQTT Host")
o.default = "mqtt.server.com"
-- Detectors Configuration
s = m:section(NamedSection, "detectors", "frigate_config", "TPU Configuration")
s.addremove = false
s.anonymous = true
o = s:option(Flag, "coral", "Enable Coral")
o.default = "1"
o = s:option(Value, "type", "Type")
o.default = "edgetpu"
o = s:option(Value, "device", "Device")
o.default = "usb"
-- Camera Configuration
s = m:section(TypedSection, "camera_config", "Camera Configuration")
s.addremove = true
s.anonymous = true
s.novaluetext = "There are no cameras configured yet."
o = s:option(Value, "name", "Camera Name")
o = s:option(Value, "path", "RTSP Path")
o = s:option(Value, "roles", "Roles")
o = s:option(Flag, "record", "Enable Recording")
o = s:option(Flag, "snapshots", "Enable Snapshots")
o = s:option(Value, "mask", "Mask")
return m