python-broadlink: 0.15.0 Seems to have broken the cli?

Hi! When scanning for devices in 0.14.1 I could discover 2 devices. Now in 0.15.0 it returns no devices when discovering.

Do the examples need to be updated? Or has the API change? Or did this break it?

devices = broadlink.discover(timeout=5) returns nothing now

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

import broadlink as blk

d = blk.hello("192.168.0.98")  # Device IP address.
print (d)
d.hello() 
devices = blk.discover(timeout=10, discover_ip_address="192.168.0.255")

for device in devices:
    print(f'device.enter_learning: {device.enter_learning}')
    if device.auth():
        device.enter_learning()
<rm4: Broadlink RM4 mini (0x648d) at 192.168.0.98:80 | mac.addr.ess | 智能遥控 | Unlocked>
device.enter_learning: <bound method rm.enter_learning of <rm4: Broadlink RM4 mini (0x648d) at 192.168.0.98:80 | mac.addr.ess | 智能遥控 | Unlocked>>
device.enter_learning: <bound method rm.enter_learning of <rm4: Broadlink RM mini 3 (0x5f36) at 192.168.0.238:80 | mac.addr.ess | 智能遥控 | Unlocked>>

Yeah, it works by only setting discover_ip_address.

Without discover_ip_address="192.168.0.255" or local_ip_address="192.168.0.150" it can’t discover and devices because I am assuming it’s bound to the wrong interface or no interface and can’t broadcast.

Nice. Let me be sure it works. That’s how I use it inside of a docker container. I am building a web API and a simple front end all containerized. It’s not pretty but it works.

Check if the devtype is supported. The rm4 class should have .enter_learning(). It needs to be here.