KraigM / homebridge-harmonyhub

HomeBridge Plugin for Logitech Harmony Hub
182 stars 52 forks source link

Trigger activity switching only if current state changed #88

Closed myMartek closed 2 years ago

myMartek commented 7 years ago

On my local setup I have some devices that only have a "On/Off" button on their remotes.

Without this pull-request I have the problem that when I tell Siri to shutdown an activity which is not on it will power on devices instead of making sure that those are turned off.

This pullrequest ensures that only those changes for activity states are pushed to the hub which are actually changing the active state.

djrobx commented 7 years ago

Can this be made optional?

I like the current behavior. I can always say "Turn the TV off", and the TV will shut off, even if I'm actually on the Xbox 360 activity.

Mine does not work as you describe. I can say turn the TV off multiple times and nothing bad happens. All of my devices have discrete power settings though. Been a while since I've seen something without discrete power codes. :)

myMartek commented 6 years ago

I added a new config switch skipIfSameState.

The default behavior will be the previous one. So my change will become optional with this pull request.

Nastras commented 6 years ago

Have tested your pull because I was also affected by the problem. Works perfectly. Too bad that Harmony Plugin is no longer being developed.

A big thank you for the function!