Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod for dimming some lights at fractional levels #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion dim-with-me.app.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

// Automatically generated. Make future change here.
definition(
name: "Dim With Me",
name: "Dim Proportional to Me",
namespace: "wackware",
author: "[email protected]",
description: "Follows the dimmer level of another dimmer",
Expand Down Expand Up @@ -73,6 +73,24 @@ preferences {
title: "Slave Dimmer Switch(es)...",
required: true
}
section("And these will follow with 1/4 dimming level...") {
input "slavesquarter", "capability.switchLevel",
multiple: true,
title: "Slave 1/4 Dimmer Switch(es)...",
required: false
}
section("And these will follow with 1/3 dimming level...") {
input "slavesthird", "capability.switchLevel",
multiple: true,
title: "Slave 1/3 Dimmer Switch(es)...",
required: false
}
section("And these will follow with 1/2 dimming level...") {
input "slaveshalf", "capability.switchLevel",
multiple: true,
title: "Slave 1/2 Dimmer Switch(es)...",
required: false
}
}

def installed()
Expand Down Expand Up @@ -102,6 +120,9 @@ def switchSetLevelHandler(evt)
level = level.toInteger()
log.info "switchSetLevelHandler Event: ${level}"
slaves?.setLevel(level)
slavesquarter?.setLevel(level/4)
slavesthird?.setLevel(level/3)
slaveshalf?.setLevel(level/2)
}

def switchOffHandler(evt) {
Expand Down