automation_rs/config/kettle.lua
Dreaded_X 4f372aa9f0
All checks were successful
Build and deploy / Build application (push) Successful in 3m22s
Build and deploy / Build container (push) Successful in 56s
Build and deploy / Deploy container (push) Has been skipped
WIP: Made config modular
2024-11-30 06:35:36 +01:00

36 lines
775 B
Lua

local h = require("helper")
return function(mqtt_client, debug)
local kettle = IkeaOutlet.new({
outlet_type = "Kettle",
name = "Kettle",
room = "Kitchen",
topic = h.mqtt_z2m("kitchen/kettle"),
client = mqtt_client,
timeout = debug and 5 or 300,
})
automation.device_manager:add(kettle)
local function set_kettle(on)
kettle:set_on(on)
end
automation.device_manager:add(IkeaRemote.new({
name = "Remote",
room = "Bedroom",
client = mqtt_client,
topic = h.mqtt_z2m("bedroom/remote"),
single_button = true,
callback = set_kettle,
}))
automation.device_manager:add(IkeaRemote.new({
name = "Remote",
room = "Kitchen",
client = mqtt_client,
topic = h.mqtt_z2m("kitchen/remote"),
single_button = true,
callback = set_kettle,
}))
end