Skip to content

Commit

Permalink
Added plant watering channel
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Aug 25, 2011
1 parent 07c5a62 commit 99ebf02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/config.yml.sample
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ AlarmChannel: 3
HallLightChannel: 4 HallLightChannel: 4
FanChannel: 5 FanChannel: 5
UmbrellaChannel: 7 UmbrellaChannel: 7
WaterPlantsChannel: 6


SwitchDelay: 0.5 SwitchDelay: 0.5
MsgDelay: 2.5 MsgDelay: 2.5
Expand Down
6 changes: 6 additions & 0 deletions octopus_sinatra.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def relative(filename)
HallLightChannel = $config["HallLightChannel"] HallLightChannel = $config["HallLightChannel"]
FanChannel = $config["FanChannel"] FanChannel = $config["FanChannel"]
UmbrellaChannel = $config["UmbrellaChannel"] UmbrellaChannel = $config["UmbrellaChannel"]
WaterPlantsChannel = $config["WaterPlantsChannel"]


$hall_light_on, $fan_on, $umbrella_on = false, false, false $hall_light_on, $fan_on, $umbrella_on = false, false, false
$hall_light_thread = nil $hall_light_thread = nil
Expand Down Expand Up @@ -292,6 +293,11 @@ def hall_light_trigger
$umbrella_on = false $umbrella_on = false
@message = "Umbrella bucket is off." @message = "Umbrella bucket is off."
end 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" when "Edit Authorizations"
# Edit authorized users list # Edit authorized users list
@filename = File.join(File.dirname(__FILE__), "config/authorized_users.yml") @filename = File.join(File.dirname(__FILE__), "config/authorized_users.yml")
Expand Down
3 changes: 3 additions & 0 deletions views/index.erb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<input type="submit" name="action" class="action" value="Turn Umbrella Bucket [ON]" /> <input type="submit" name="action" class="action" value="Turn Umbrella Bucket [ON]" />
<% end %> <% end %>
</li> </li>
<li>
<input type="submit" name="action" class="action" value="Water plants (for 3 seconds)" />
</li>
</ul> </ul>


<hr/> <hr/>
Expand Down

0 comments on commit 99ebf02

Please sign in to comment.