diff --git a/broadlink/switch.py b/broadlink/switch.py index b25d069..9d975cc 100644 --- a/broadlink/switch.py +++ b/broadlink/switch.py @@ -246,11 +246,11 @@ class sp4(device): """Set state of device.""" data = {} if pwr is not None: - data["pwr"] = pwr + data["pwr"] = int(bool(pwr)) if ntlight is not None: - data["ntlight"] = ntlight + data["ntlight"] = int(bool(ntlight)) if indicator is not None: - data["indicator"] = indicator + data["indicator"] = int(bool(indicator)) if ntlbrightness is not None: data["ntlbrightness"] = ntlbrightness if maxworktime is not None: