Help me understand this errror please (broadlink switch)

Good Evening,

I’m getting the bellow error in my home assistant (latest version) with regards to my broadlink switches.

2018-08-08 23:07:19 INFO (MainThread) [homeassistant.components.switch] Setting up switch.broadlink
2018-08-08 23:07:19 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py", line 143, in setup_platform
    broadlink_device = broadlink.rm((ip_addr, 80), mac_addr, None)
TypeError: __init__() takes 3 positional arguments but 4 were given

I’ve reduced my switches.yaml to one code (for testing purposes):

- platform: broadlink
  host: 192.168.1.194
  mac: 'mac address with : every two characters'
  timeout: 15
  switches:
    landing_light:
      command_on: 'sgw0AB8KCx0fCh8KHwoLHh8JCx0LHR8KHwoLHQsdCx0fCh8KHwoLHR8KCx0LHR8KCx0MHQsAATAAAAAA'
      command_off: 'sgk0AB8KCx0fCh8KHwoLHh8KCx0MHR8KHwoMHQsdCx4fCh8KHwoLHR8KDB0fCQwdCx0LHQsAATAAAAAA'

what os are you running? This error is a python error related to the number of arguments passed to the function rm inside the broadlink class. Bascially, it expects 2 inputs (one is self), and the component is giving 3 + self. I’d verify that you have an up to date broadlink resource file.

Running Hassio.

How would I do this is Hassio (check I have the latest broadlink resource file).

Would I just get the latest .py file form git hub and put it in custom component (so it overrides the one running), or am I miles off?

I’m not sure, if you are running hassio, it should be correct. The only thing I can think of is that somehow the resource is outdated?

maybe broadlink should use type property?

@Knottyboy, yeah i just noticed that too. Some broadlink devices require a type:

I had it working in 0.66.1 without the type and I don’t think type was one of the breaking changes. I have tried using rm2 (which I’m 90% sure is what mine is) and that didn’t help.

Right must be something to do with my initial install. The same details work fine on a fresh install with etcher but if I revert back to the SD card that was updated over time it doesn’t work.

Odd…