n8henrie / homebridge-rcswitch-gpiomem

Integrate your 433 remote switches into homebridge
MIT License
11 stars 3 forks source link

setPulse doesn't work for two accessories with two different pulses #2

Closed jcbriones closed 8 years ago

jcbriones commented 8 years ago

setPulse doesn't work for two accessories with two different pulses. I'm trying to solve this on your script but just letting you know that it doesn't work 😊

n8henrie commented 8 years ago

Huh. Thanks for the report -- unfortunately I don't have a great way to test.

I assume you're talking about pulse length -- can you provide a little more detail?

What pulse lengths are you trying? Does it work on the two devices individually?

What does your config look like?

n8henrie commented 8 years ago

I've pushed a change to the dev branch -- @jcbriones can you install that and see if it fixes the issue?

jcbriones commented 8 years ago

Ok I'll try :)

jcbriones commented 8 years ago

Hi n8henrie, it does work now. Also, I suggest putting the other two inside the service as well.

    rcswitch.enableTransmit(config.pin || 17);
    rcswitch.setRepeatTransmit(config.repeats || 10);
jcbriones commented 8 years ago

Thanks! Nice code btw.

n8henrie commented 8 years ago

Thanks -- wish I could take more credit, but I don't know much javascript and didn't make much modification to existing code.

What would be the reason to move the others? Seems like it would slow things down, and I don't imagine much benefit.

jcbriones commented 8 years ago

For the enableTransmit, it can stay where it is but for setRepeat, I also set mine to different settings inside my config.json for those devices that only accepts lower count of repeats or else it doesn't function properly.

n8henrie commented 8 years ago

Huh, you have devices that only accept lower amounts? I haven't heard of this (though common to only work with higher amounts in cases of poor transmission).

jcbriones commented 8 years ago

Yeah it's actually weird. I have an LED strip lights that only works with transmitting the same data for 3 to 5 times only. More than that will cause it to turn on and then turn off back again since it's using the same code to turn on and off.

n8henrie commented 8 years ago

Fair enough, I just pushed 1.1.3 to dev -- let me know if it works for you, if so I'll push it to npm. Thanks for the feedback.

jcbriones commented 8 years ago

I just checked the code and seem to be fine since I edit your code to work on my end. Thanks!