How do you manage your "PowerToggle"

Hi, I already ask this question for my tv but now I have led too who have a Power toggle Button. and it’s a pain !

So here the deal my tv and my led strip have a toggle on/off button so a make a rule in openHAB :

if receive command on send power toggle button and if receive command off send Power Toggle Button.

After, I “sync” my device with Openhab (if my device is on and openhab think it’s off i take the original remote to power it off)

So, with this i can manage if my tv or my led are on or of and make other rule on this. Like my Night mode that close everything. My issue is if the command did not end well and for exemple i accidentels hit two time the off buton for my tv my tv still gonna power off but then openHab gonna think i open it back after since i press two time so if i activate the night mode my tv gonna open …

Use a Latch Design Pattern to ignore command that occur too close together.