Update utils
This commit is contained in:
@@ -49,19 +49,10 @@ do
|
||||
---@param groupAddress string
|
||||
---@param value number
|
||||
Send = function(dpt, groupAddress, value)
|
||||
local tParams = {}
|
||||
local tParams = C3C.KnxCodec.For(dpt).encode(value)
|
||||
tParams.DATA_POINT_TYPE = dpt
|
||||
tParams.GROUP_ADDRESS = groupAddress
|
||||
|
||||
if dpt == "DPT_232" then
|
||||
local hex = string.format("%06x", value)
|
||||
tParams.R = tonumber(hex:sub(1,2), 16)
|
||||
tParams.G = tonumber(hex:sub(3,4), 16)
|
||||
tParams.B = tonumber(hex:sub(5,6), 16)
|
||||
else
|
||||
tParams.VALUE = value
|
||||
end
|
||||
|
||||
send("SEND_TO_KNX", tParams)
|
||||
end,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user