refactor: Split config
Some checks are pending
Build and deploy / build (push) Waiting to run
Build and deploy / Deploy container (push) Blocked by required conditions

This commit is contained in:
2025-10-20 04:39:12 +02:00
parent be77711caf
commit 8b4ea06957
20 changed files with 1083 additions and 756 deletions

View File

@@ -0,0 +1,47 @@
local battery = require("config.battery")
local devices = require("automation:devices")
local helper = require("config.helper")
local hue_bridge = require("config.hue_bridge")
local module = {}
--- @type SetupFunction
function module.setup(mqtt_client)
local light = devices.HueGroup.new({
identifier = "hallway_top_light",
ip = hue_bridge.ip,
login = hue_bridge.token,
group_id = 83,
scene_id = "QeufkFDICEHWeKJ7",
})
local top_switch = devices.HueSwitch.new({
name = "SwitchTop",
room = "Hallway",
client = mqtt_client,
topic = helper.mqtt_z2m("hallway/switchtop"),
left_callback = function()
light:set_on(not light:on())
end,
battery_callback = battery.callback,
})
local bottom_switch = devices.HueSwitch.new({
name = "SwitchBottom",
room = "Hallway",
client = mqtt_client,
topic = helper.mqtt_z2m("hallway/switchbottom"),
left_callback = function()
light:set_on(not light:on())
end,
battery_callback = battery.callback,
})
return {
light,
top_switch,
bottom_switch,
}
end
return module