Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return {
- on = {
- devices = {'Кнопка кухня'}
- },
- logging = {
- level = domoticz.LOG_ERROR
- },
- execute = function(dz, item)
- local Lights = dz.devices().filter({'Кухня Бра ЛЕВ', 'Кухня Бра ПРАВ'})
- local bright = 100
- Lights.forEach(function(Light)
- if (item.name == 'Кнопка кухня' and item.state ~= 'Off') then
- if (item.levelName == 'Click') then
- if (Light.state ~= 'Off') then
- Light.switchOff()
- else
- Light.dimTo(bright)
- end
- end
- if (item.levelName == 'Double Click') then
- if (Light.state ~= 'Off') then
- bright = Light.level
- Light.dimTo(bright - 20)
- end
- end
- if (item.levelName == 'Long Click') then
- if (Light.state ~= 'Off') then
- bright = Light.level
- if (bright <= 80) then
- Light.dimTo(bright + 20)
- end
- end
- end
- item.switchOff()
- end
- end)
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement