Commit 2a1ef250 authored by Keegi's avatar Keegi

Merge pull request #56 from alexrj/fan-macro

Added a macro and button definition for controlling fan
parents d2b90ebe 6bf34a81
# Sample .pronsolerc file - copy this into your home directory and rename it to .pronsolerc
!print "Loaded " + self.rc_filename
macro loud
!if self.p.loud:
!self.p.loud = 0
......@@ -10,3 +11,17 @@ macro loud
!if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "loud (on)" /c yellow loud' % self.cur_button)
button 0 "loud (off)" /c "green" loud
macro fan
!global _fan
!if '_fan' in globals() and _fan:
!_fan = 0
M107
!if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "fan (off)" /c green fan' % self.cur_button)
!else:
!_fan = 1
M106
!if hasattr(self,"cur_button") and self.cur_button is not None:
!self.onecmd('button %d "fan (on)" /c yellow fan' % self.cur_button)
button 1 "fan (off)" /c "green" fan
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment