pad packets to multiple of 4 characters (#10560)

* pad packets to multiple of 4 characters

This fixes sending commands, see #7669

* Update broadlink.py

* removed whitespace
This commit is contained in:
Steve Edson authored and Daniel Høyer Iversen committed 2017-11-14 09:18:06 +01:00
1 parent 7c24d77031
commit b1afed9e52
1 file changed
+3
@@ -117,6 +117,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for packet in packets:
for retry in range(DEFAULT_RETRY):
try:
extra = len(packet) % 4
if extra > 0:
packet = packet + ('=' * (4 - extra))
payload = b64decode(packet)
yield from hass.async_add_job(
broadlink_device.send_data, payload)