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:
parent
7c24d77031
commit
b1afed9e52
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue