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 2017-11-14 08:18:06 +00:00 committed by Daniel Høyer Iversen
parent 7c24d77031
commit b1afed9e52

View File

@ -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)