User Tools

Site Tools


mosh:element_library:switch

This is an old revision of the document!


Switch

  • ACTION_RESET - sent when the switch is first registered.
  • ACTION_STATE_ON - sent when the switch is placed in the “on” position
  • ACTION_STATE_OFF - sent when the switch is planed on the “off” position
  • ACTION_STATE_FLICK - sent when the switch is moved from either on-off-on, or off-on-off within the flick_delay

Configuration

uint16_t flick_delay = 250;
switch_element.set_flick_delay(flick_delay); //default is 250ms

Properties

switch_element.get_state(); //current state of switch (on/off)

Element Message

enum class MOSH_Element_Switch_Action : uint8_t {
    ACTION_RESET            = 0x00,
    ACTION_STATE_ON         = 0x01,
    ACTION_STATE_OFF        = 0x02,
    ACTION_STATE_FLICK      = 0x03,
    ...
    MSG_CUSTOM         = 0xFF  // Reserved for user-defined
};
/var/www/wiki.moshnetworks.com/data/attic/mosh/element_library/switch.1750989959.txt.gz · Last modified: by mosh

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki