Skip to content

Commit ac4fab3

Browse files
committed
fix for python-broadlink v0.15.0 (reverse MAC format)
1 parent 8ddadaf commit ac4fab3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mqtt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ def get_device(cf):
363363
mqtt_subprefix = mqtt_multiple_prefix_format.format(
364364
type=device.type,
365365
host=device.host[0],
366-
mac='_'.join(format(s, '02x') for s in device.mac[::-1]),
367-
mac_nic='_'.join(format(s, '02x') for s in device.mac[2::-1]))
366+
mac='_'.join(format(s, '02x') for s in device.mac),
367+
mac_nic='_'.join(format(s, '02x') for s in device.mac[3::]))
368368
device = configure_device(device, topic_prefix + mqtt_subprefix)
369369
devices_dict[mqtt_subprefix] = device
370370
return devices_dict
@@ -397,8 +397,8 @@ def get_device(cf):
397397

398398
def configure_device(device, mqtt_prefix):
399399
device.auth()
400-
logging.debug('Connected to \'%s\' Broadlink device at \'%s\' (MAC %s) and started listening for commands at MQTT topic having prefix \'%s\' '
401-
% (device.type, device.host[0], ':'.join(format(s, '02x') for s in device.mac[::-1]), mqtt_prefix))
400+
logging.debug('Connected to \'%s\' Broadlink device at \'%s\' (MAC %s) and started listening to MQTT commands at \'%s#\' '
401+
% (device.type, device.host[0], ':'.join(format(s, '02x') for s in device.mac), mqtt_prefix))
402402

403403
broadlink_rm_temperature_interval = cf.get('broadlink_rm_temperature_interval', 0)
404404
if (device.type == 'RM2' or device.type == 'RM4') and broadlink_rm_temperature_interval > 0:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
paho-mqtt
2-
broadlink
2+
broadlink>=0.15.0

0 commit comments

Comments
 (0)