Browse Source

Fix merge

rules-rpn
Xose Pérez 5 years ago
parent
commit
7e92bbe253
2 changed files with 6 additions and 9 deletions
  1. +0
    -4
      code/espurna/light.ino
  2. +6
    -5
      code/espurna/rpnrules.ino

+ 0
- 4
code/espurna/light.ino View File

@ -43,10 +43,6 @@ struct channel_t {
};
std::vector<channel_t> _light_channel;
bool _light_dirty = false;
bool _light_state = false;
bool _light_use_transitions = false;
unsigned int _light_transition_time = LIGHT_TRANSITION_TIME;
bool _light_has_color = false;
bool _light_use_white = false;
bool _light_use_cct = false;


+ 6
- 5
code/espurna/rpnrules.ino View File

@ -21,13 +21,12 @@ unsigned long _rpn_last = 0;
// -----------------------------------------------------------------------------
bool _rpnWebSocketOnReceive(const char * key, JsonVariant& value) {
bool _rpnWebSocketOnKeyCheck(const char * key, JsonVariant& value) {
return (strncmp(key, "rpn", 3) == 0);
}
void _rpnWebSocketOnSend(JsonObject& root) {
void _rpnWebSocketOnConnected(JsonObject& root) {
root["rpnVisible"] = 1;
root["rpnSticky"] = getSetting("rpnSticky", 1).toInt();
root["rpnDelay"] = getSetting("rpnDelay", RPN_DELAY).toInt();
JsonArray& rules = root.createNestedArray("rpnRules");
@ -296,8 +295,10 @@ void rpnSetup() {
// Websockets
#if WEB_SUPPORT
wsOnSendRegister(_rpnWebSocketOnSend);
wsOnReceiveRegister(_rpnWebSocketOnReceive);
wsRegister()
.onVisible([](JsonObject& root) { root["rpnVisible"] = 1; })
.onConnected(_rpnWebSocketOnConnected)
.onKeyCheck(_rpnWebSocketOnKeyCheck);
#endif
// MQTT


Loading…
Cancel
Save