Conversation
… State of light then depends on switch on/off (direct or inverted logic selectable).
|
Hmmmm, interesting idea... I like what you have here. Good work :) |
|
As an additional info: the reason for adding the TOGGLE gcode is that I wanted to easily switch the light using OctoDash. So I added a button there that executes the gcode ( https://github.com/jjsat/OctoDash/tree/light_switch ). It can also be just added into the action bar as a custom action. Thanks for taking the time to review. |

This change adds the option of using a toggle switch to control the light state. It can be selected whether the light follows the switch state (light on = switch on) or if the logic should be inverted.
Also adds a new custom gcode that toggles the current light state in addition to the existing on/off commands.
Motivation for this change is the use of a enclosure with a door switch that can automatically turn on the light when the door is opened and turn it off again when closing the door. It is still possible to override this behaviour and toggle the light state at will with the light bulb button in the web UI.