From 883e953ea70df00d24e55bf9d9ba2be90ec34432 Mon Sep 17 00:00:00 2001 From: Rogier van Staveren Date: Thu, 27 Jun 2024 14:44:51 +0200 Subject: [PATCH] Fix switch5 protocol --- rfcontrol/protocols/switch5.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rfcontrol/protocols/switch5.py b/rfcontrol/protocols/switch5.py index 29312ae..5cbb862 100644 --- a/rfcontrol/protocols/switch5.py +++ b/rfcontrol/protocols/switch5.py @@ -64,6 +64,7 @@ def encode(id: int, unit: int, state: bool, all: bool = False): encoded = binary2pulses(f"{id:020b}", binary2pulses_mapping) if all: unit_code = 6 if state else 7 + state = not state else: unit_code = (None, 0, 1, 2, 4)[unit] encoded += binary2pulses(f"{unit_code:03b}", binary2pulses_mapping)