rench / homebridge-smarthome

this is a homebridge plugin for mijia eco-chain but also a management webapp provide web and restapi to manage your mijia eco-chain,you can control and monitor your accessory via apple's homekit or the webapp
MIT License
39 stars 4 forks source link

Mi Smart switch (round button) #10

Open mistert871 opened 6 years ago

mistert871 commented 6 years ago

Hi,

The Mi Smart switch (round button) with 3 options: 1 click, 2 click and long press/click. The first 2 options works perfectly, but the third option doesn't work. I see long press in Homekit but it doesn't work.

Is this a known bug? And can you please fix it or tell me how to fix it?

Thanks!

Regards, Tim

rench commented 6 years ago

I'm sorry, my new house is being renovated, and over time I will test the equipment you are referring to and give you a reply

mistert871 commented 6 years ago

Thanks Rench. Do you know when you can reply? Im really waiting for it. Is there something I can test? THanks

mistert871 commented 6 years ago

Do you know when you can reply? Im really waiting for it. Is there something I can test? THanks

hatack commented 6 years ago

Hi,

just add this condition to kit/mijia/switch.js (cca line 60):

  } else if (status == 'long_click_press') {
    event.updateValue(Characteristic.ProgrammableSwitchEvent.LONG_PRESS); //2
  }