Skip to content

Toggle on/off with ir.json does not work very well #2231

Closed

Description

@mase76

Hi!
I added a custom ir.json to the filesystem. However on/off does not work very well. I have to press the button multiple times to get a reaction. All other buttons work fine. When I add my code with #define IRCUSTOM_ONOFF into ir_codes.h, the reaction is fine. This is the on/off part of my json file:
"0xFF02FD": { "label": "Toggle on/off", "pos": "1x4", "cmd": "T=2", "rpt": true },

Activity

  1. blazoncek commented on Sep 26, 2021

    @blazoncek
    Contributor

    I have noticed that too occasionally but have attributed this to the repeat function of buttons.
    If I hold the on/off toggle button for a bit too long is starts repeating (you can see 0xFFFFFFFF sent) and that may confuse JSON code.
    @scottrbailey may need to take a look.

  2. mase76 commented on Sep 26, 2021

    @mase76
    Author

    I removed the rpt option, but this did not nake it better

  3. blazoncek commented on Sep 27, 2021

    @blazoncek
    Contributor

    It is handling of repeatable codes that is an issue, not your JSON.
    You will need to wait for Scott.

  4. scottrbailey commented on Sep 28, 2021

    @scottrbailey
    Contributor

    It seems to be rather an issue handling of any value of &T=[0,1,2]
    Calling from HTTP request works fine as does changing to {"on": true}

  5. scottrbailey commented on Sep 28, 2021

    @scottrbailey
    Contributor

    Also works when routing through JSON api.
    "cmd": {"win": "&T=2"}

  6. mase76 commented on Sep 28, 2021

    @mase76
    Author

    But why are there no issues when defining the on/off toggle in ir_codes.h?

  7. scottrbailey commented on Sep 28, 2021

    @scottrbailey
    Contributor

    I tracked down the issue. It was because colorUpdated() wasn't being called for HTTP commands.

  8. blazoncek commented on Oct 3, 2021

    @blazoncek
    Contributor

    Fixed in latest code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions