Permalink
Browse files

Added plant watering channel

  • Loading branch information...
1 parent 07c5a62 commit 99ebf0295ca38ba7f7c8d762f0142831d4819689 @ndbroadbent committed Aug 25, 2011
Showing with 10 additions and 0 deletions.
  1. +1 −0 config/config.yml.sample
  2. +6 −0 octopus_sinatra.rb
  3. +3 −0 views/index.erb
View
@@ -5,6 +5,7 @@ AlarmChannel: 3
HallLightChannel: 4
FanChannel: 5
UmbrellaChannel: 7
+WaterPlantsChannel: 6
SwitchDelay: 0.5
MsgDelay: 2.5
View
@@ -26,6 +26,7 @@ def relative(filename)
HallLightChannel = $config["HallLightChannel"]
FanChannel = $config["FanChannel"]
UmbrellaChannel = $config["UmbrellaChannel"]
+WaterPlantsChannel = $config["WaterPlantsChannel"]
$hall_light_on, $fan_on, $umbrella_on = false, false, false
$hall_light_thread = nil
@@ -292,6 +293,11 @@ def hall_light_trigger
$umbrella_on = false
@message = "Umbrella bucket is off."
end
+ when "Water plants (for 3 seconds)"
+ $k8055.set_digital WaterPlantsChannel, false
+ sleep 3
+ $k8055.set_digital WaterPlantsChannel, false
+ @message = "Plants watered."
when "Edit Authorizations"
# Edit authorized users list
@filename = File.join(File.dirname(__FILE__), "config/authorized_users.yml")
View
@@ -60,6 +60,9 @@
<input type="submit" name="action" class="action" value="Turn Umbrella Bucket [ON]" />
<% end %>
</li>
+ <li>
+ <input type="submit" name="action" class="action" value="Water plants (for 3 seconds)" />
+ </li>
</ul>
<hr/>

0 comments on commit 99ebf02

Please sign in to comment.