Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for optional 'the' after matching light name

  • Loading branch information...
commit 8c55a02ad29faaec0d71d67b9f1e66e2b8153e4b 1 parent d68a10b
@interstateone authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/siriproxy-hue.rb
View
6 lib/siriproxy-hue.rb
@@ -146,14 +146,14 @@ def setAbsoluteBrightness(value, matchedEntity)
request_completed
end
# Binary state
- listen_for %r/turn (on|off)(?: the)? ([a-z ]*) light(?:s)?/i do |state, entity|
+ listen_for %r/turn (on|off)(?: the)? ([a-z ]??*)(?: the)? light(?:s)?/i do |state, entity|
checkRegistration
matchedEntity = ensureMatchedEntity(entity)
switchEntity(state, matchedEntity)
end
# Relative brightness
- listen_for %r/turn (up|down)(?: the)? ([a-z ]*) light(?:s)?/i do |change, entity|
+ listen_for %r/turn (up|down)(?: the)? ([a-z ]??*)(?: the)? light(?:s)?/i do |change, entity|
checkRegistration
matchedEntity = ensureMatchedEntity(entity)
setRelativeBrightness(change, matchedEntity)
@@ -162,7 +162,7 @@ def setAbsoluteBrightness(value, matchedEntity)
# Absolute brightness/color change
# Numbers (0-254) and percentages (0-100) are treated as brightness values
# Single words are used as a color query to lookup HSV values
- listen_for %r/set(?: the)? ([a-z ]*) light(?:s)? to ([a-z0-9% ]*)/i do |entity, value|
+ listen_for %r/set(?: the)? ([a-z ]??*)(?: the)? light(?:s)? to ([a-z0-9% ]*)/i do |entity, value|
checkRegistration
matchedEntity = ensureMatchedEntity(entity)
setAbsoluteBrightness(value, matchedEntity)
Please sign in to comment.
Something went wrong with that request. Please try again.