homebridge-switchbot icon indicating copy to clipboard operation
homebridge-switchbot copied to clipboard

Bug: "Other" IR Devices send commandOn and commandOff at reversed times

Open jonzhan opened this issue 2 years ago • 1 comments

Describe The Bug

When turning on a device, it sends commandOff, and vice versa

To Reproduce

Set up an IR "Other" device and try toggling state.

Expected behavior

Turning on a device should use the configured commandOn command, not commandOff

Relevant log output

(When turning a device off)

[12/04/2022, 15:31:22] [SwitchBot] [DEBUG] Other: Iceman On: 0
[12/04/2022, 15:31:22] [SwitchBot] Other: Iceman Sending request to SwitchBot API. command: On, parameter: default, commandType: customize
[12/04/2022, 15:31:23] [SwitchBot] [DEBUG] Other: Iceman pushChanges: [object Object]
[12/04/2022, 15:31:23] [SwitchBot] [DEBUG] Other: Iceman Command successfully sent.
[12/04/2022, 15:31:23] [SwitchBot] [DEBUG] Other: Iceman updateCharacteristic Active: 1

Config for homebridge-switchbot

{
    "deviceId": "xxxxxxxxx",
    "configRemoteType": "Fan",
    "other": {
        "deviceType": "Fan",
        "commandOff": "Off",
        "commandOn": "On"
    },
        "logging": "debug"
}

Screenshots

No response

Device & Model

Raspberry Pi 3

Node.js Version

v16.13.0

NPM Version

v8.1.0

Homebridge Version

v1.4.0

Homebridge Switchbot Plugin Version

v1.12.8

Homebridge Config UI X Plugin Version

v4.42.0

Operating System

Raspbian

jonzhan avatar Apr 12 '22 07:04 jonzhan

I submitted a PR for this but it's my first, so apologies if I did anything wrong.

jonzhan avatar Apr 12 '22 07:04 jonzhan

should be resolved from PR

donavanbecker avatar Oct 14 '22 07:10 donavanbecker