Get rid of deps
This commit is contained in:
@@ -23,6 +23,20 @@ do
|
||||
}
|
||||
|
||||
local responding = false
|
||||
local throttlingRead = false
|
||||
|
||||
function class:Read()
|
||||
if throttlingRead == false then
|
||||
C3C.KnxProxy.Read(class.GA)
|
||||
end
|
||||
|
||||
throttlingRead = true
|
||||
|
||||
C3C.OneShotTimer.Add(10000, function()
|
||||
throttlingRead = false
|
||||
C3C.KnxProxy.Read(class.GA)
|
||||
end, "GroupAddressReadThrottle" .. class.GA)
|
||||
end
|
||||
|
||||
---@param v number
|
||||
function class:Send(v)
|
||||
@@ -31,6 +45,7 @@ do
|
||||
end
|
||||
|
||||
function class:RespondToRead()
|
||||
C3C.KnxAddresses.Watch(class.Name)
|
||||
responding = true
|
||||
end
|
||||
|
||||
@@ -99,7 +114,7 @@ do
|
||||
---@param onValueChange nil|fun(current: GroupAddress, state: { newVal: number, prevVal: number? })
|
||||
Watch = function(n, onValueReceive, onValueChange)
|
||||
if namedRegistry[n] == nil then
|
||||
C3C.Logger.Error(W
|
||||
C3C.Logger.Error(
|
||||
"error accessing non existing group address name to Listen, this should never happen...never",
|
||||
{ name = n }
|
||||
)
|
||||
@@ -180,6 +195,8 @@ do
|
||||
if addr ~= nil and addr.Value ~= nil and addr:isResponding() then
|
||||
addr:Send(addr.Value)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if strCommand ~= "DATA_FROM_KNX" then
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
---|"Control LF Hallway Presence"
|
||||
---|"Control LF Hallway Presence Enable"
|
||||
---|"Control LF Hallway Presence Enable Workaround"
|
||||
---|"Control LF Hallway Presence End"
|
||||
---|"Control LF Hallway Presence Alarm"
|
||||
---|"Control LF Hallway Presence Alarm State"
|
||||
---|"Control LF Study LED Brightness Night"
|
||||
@@ -408,7 +409,7 @@
|
||||
---|"Heat Temperature Setpoint"
|
||||
--- HAS UNKNOWN DPT
|
||||
---|"Heat Temperature Setpoint State"
|
||||
---|"Heat Heating Off lock"
|
||||
---|"Heat Heating Off Lock"
|
||||
---|"Heat UF+LF Heating Circulation Pump"
|
||||
---|"Heat UF+LF Heating Circulation Pump State"
|
||||
|
||||
@@ -581,6 +582,8 @@
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary Light 2"
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary Light Table"
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary FB"
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary CTRL FB"
|
||||
@@ -588,6 +591,8 @@
|
||||
---|"Switch LF Study Primary Light 1 FB"
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary Light 2 FB"
|
||||
--- Study Primary
|
||||
---|"Switch LF Study Primary Light Table State"
|
||||
--- Study Ambient
|
||||
---|"Switch LF Study Ambient"
|
||||
--- Study Ambient
|
||||
@@ -651,17 +656,9 @@
|
||||
---|"Switch UF Hallway Entry"
|
||||
---|"Switch UF Hallway Isle"
|
||||
---|"Switch UF Hallway CTRL"
|
||||
---|"Switch UF Hallway Entry 1"
|
||||
---|"Switch UF Hallway Entry 2"
|
||||
---|"Switch UF Hallway Isle 1"
|
||||
---|"Switch UF Hallway Isle 2"
|
||||
---|"Switch UF Hallway Entry FB"
|
||||
---|"Switch UF Hallway Isle FB"
|
||||
---|"Switch UF Hallway CTRL FB"
|
||||
---|"Switch UF Hallway Entry 1 FB"
|
||||
---|"Switch UF Hallway Entry 2 FB"
|
||||
---|"Switch UF Hallway Isle 1 FB"
|
||||
---|"Switch UF Hallway Isle 2 FB"
|
||||
---|"Switch UF Bathroom Primary"
|
||||
---|"Switch UF Bathroom Primary CTRL"
|
||||
---|"Switch UF Bathroom Primary Light 1"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
---@return table<number,GroupAddress>
|
||||
function C3CKnxCreateGroupAddresses()
|
||||
return {
|
||||
return {
|
||||
C3C.KnxGroupAddress("Entry", "0/0/1", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Exit", "0/0/2", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Present", "0/0/3", "DPT_1"),
|
||||
@@ -95,10 +94,12 @@ function C3CKnxCreateGroupAddresses()
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary CTRL", "1/0/141", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light 1", "1/0/142", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light 2", "1/0/143", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light Table", "1/0/144", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary FB", "1/0/147", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary CTRL FB", "1/0/148", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light 1 FB", "1/0/149", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light 2 FB", "1/0/150", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Primary Light Table State", "1/0/151", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Ambient", "1/0/155", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Ambient CTRL", "1/0/156", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch LF Study Ambient Light 1", "1/0/157", "DPT_1"),
|
||||
@@ -136,17 +137,9 @@ function C3CKnxCreateGroupAddresses()
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry", "1/1/0", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle", "1/1/1", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway CTRL", "1/1/2", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry 1", "1/1/3", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry 2", "1/1/4", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle 1", "1/1/5", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle 2", "1/1/6", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry FB", "1/1/7", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle FB", "1/1/8", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway CTRL FB", "1/1/9", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry 1 FB", "1/1/10", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Entry 2 FB", "1/1/11", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle 1 FB", "1/1/12", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Hallway Isle 2 FB", "1/1/13", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Bathroom Primary", "1/1/20", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Bathroom Primary CTRL", "1/1/21", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Switch UF Bathroom Primary Light 1", "1/1/22", "DPT_1"),
|
||||
@@ -503,7 +496,7 @@ function C3CKnxCreateGroupAddresses()
|
||||
C3C.KnxGroupAddress("Heat Heating-Cooling State", "3/7/1", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat Temperature Setpoint", "3/7/2", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat Temperature Setpoint State", "3/7/3", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat Heating Off lock", "3/7/4", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat Heating Off Lock", "3/7/4", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat UF+LF Heating Circulation Pump", "3/7/20", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Heat UF+LF Heating Circulation Pump State", "3/7/21", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Vent LF PLACEHOLDER Hallway", "4/0/0", "DPT_1"),
|
||||
@@ -616,6 +609,7 @@ function C3CKnxCreateGroupAddresses()
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence", "6/0/0", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence Enable", "6/0/1", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence Enable Workaround", "6/0/2", "DPT_3"),
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence End", "6/0/5", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence Alarm", "6/0/10", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Control LF Hallway Presence Alarm State", "6/0/11", "DPT_1"),
|
||||
C3C.KnxGroupAddress("Control LF Study LED Brightness Night", "6/0/146", "DPT_5"),
|
||||
@@ -625,4 +619,3 @@ function C3CKnxCreateGroupAddresses()
|
||||
C3C.KnxGroupAddress("Control UF Bathroom Brightness", "6/1/35", "DPT_9"),
|
||||
}
|
||||
end
|
||||
|
||||
+4
-3
@@ -1,4 +1,5 @@
|
||||
local VERSION = "2025.10.0"
|
||||
DRIVER_NAME = "c3c-knx-presence"
|
||||
DRIVER_VERSION = "uninitialized"
|
||||
|
||||
local ID_KNX = 1
|
||||
|
||||
@@ -7,7 +8,7 @@ require("control4-utils.hooks")
|
||||
require("control4-utils.helpers")
|
||||
require("control4-utils.knx")
|
||||
C3C.KnxProxy.Setup(ID_KNX)
|
||||
C3C.RemoteLogger.Setup("c4c-knx-presence")
|
||||
C3C.RemoteLogger.Setup(DRIVER_NAME)
|
||||
C3C.Logger.DisableRemoteLogging()
|
||||
-- C4:AllowExecute(false)
|
||||
C3C.Lib = {}
|
||||
@@ -33,7 +34,7 @@ Driver = (function()
|
||||
end
|
||||
|
||||
function class:SetInitialized()
|
||||
C3C.RemoteLogger.Info("C3C KNX Presence driver initialized", { version = VERSION })
|
||||
C3C.RemoteLogger.Info("C3C KNX Presence driver initialized", { version = DRIVER_VERSION })
|
||||
class.initialized = true
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<devicedata>
|
||||
<copyright>Copyright 2026 C3C</copyright>
|
||||
<creator>C3C</creator>
|
||||
<manufacturer>C3C</manufacturer>
|
||||
<name>KNX Presence</name>
|
||||
<model>c3c-knx-presence</model>
|
||||
<created>2023-05-14</created>
|
||||
<modified>2026-07-04</modified>
|
||||
<version>233</version>
|
||||
<agent>false</agent>
|
||||
<control>lua_gen</control>
|
||||
<controlmethod>KNX</controlmethod>
|
||||
<driver>DriverWorks</driver>
|
||||
<minimum_os_version>4.0.0</minimum_os_version>
|
||||
<proxies qty="1">
|
||||
<proxy proxybindingid="5000" name="KNX Presence" small_image="www/icons/logo_16.png" large_image="www/icons/logo_32.png" image_source="c4z">c3c-knx-presence</proxy>
|
||||
</proxies>
|
||||
<combo>true</combo>
|
||||
<connections>
|
||||
<connection>
|
||||
<id>1</id>
|
||||
<connectionname>KNX Control</connectionname>
|
||||
<facing>6</facing>
|
||||
<type>1</type>
|
||||
<consumer>true</consumer>
|
||||
<linelevel>true</linelevel>
|
||||
<classes>
|
||||
<class>
|
||||
<classname>KNX_DEVICE</classname>
|
||||
<autobind>false</autobind>
|
||||
</class>
|
||||
</classes>
|
||||
</connection>
|
||||
</connections>
|
||||
<events>
|
||||
<event>
|
||||
<id>100</id>
|
||||
<name>UpperFloorBathroomMediaStart</name>
|
||||
<description>Start Media in Upper Floor Bathroom</description>
|
||||
</event>
|
||||
<event>
|
||||
<id>101</id>
|
||||
<name>UpperFloorBathroomMediaEnd</name>
|
||||
<description>End Media in Upper Floor Bathroom</description>
|
||||
</event>
|
||||
</events>
|
||||
<config>
|
||||
<script jit="1" file="driver.lua"/>
|
||||
<documentation file="www/documentation.html"/>
|
||||
<properties>
|
||||
<property>
|
||||
<name>Log Level</name>
|
||||
<type>DYNAMIC_LIST</type>
|
||||
<readonly>false</readonly>
|
||||
</property>
|
||||
<property>
|
||||
<name>Log Mode</name>
|
||||
<type>DYNAMIC_LIST</type>
|
||||
<readonly>false</readonly>
|
||||
</property>
|
||||
</properties>
|
||||
</config>
|
||||
</devicedata>
|
||||
Reference in New Issue
Block a user