cagnulein / switchbot_press

This is a simple project that manage the Switchbot ( https://amzn.to/3dnliBD ) that has only the "press" ability in Home Assistant.
GNU Lesser General Public License v3.0
14 stars 5 forks source link

Switchbot_press won't load in HA #13

Closed JimboJones3101 closed 2 years ago

JimboJones3101 commented 2 years ago

Hi there,

as I'm struggeling with the "old" switchbot integration I just found yours, but I cannot get it up and running.

My config looks like this:

switch:
#  - platform: switchbot
#    mac: 'C6:F9:E2:BE:1A:43'
#    name: 'Switchbot 1'
#  - platform: switchbot
#    mac: 'DE:F8:02:43:01:10'
#    name: 'Switchbot 2'
#  - platform: switchbot
#    mac: 'DB:C1:C0:FB:D6:4F'
#    name: 'Switchbot 3'
  - platform: switchbot_press
    mac: 'C6:F9:E2:BE:1A:43'
  - platform: switchbot_press
    mac: 'DE:F8:02:43:01:10'
  - platform: switchbot_press
    mac: 'DB:C1:C0:FB:D6:4F'
Logger: homeassistant.components.switch
Source: custom_components/switchbot_press/switch.py:52
Integration: Switch (documentation, issues)
First occurred: 12:23:25 PM (3 occurrences)
Last logged: 12:23:25 PM

Error while setting up switchbot_press platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/switchbot_press/switch.py", line 38, in setup_platform
    add_entities([SwitchBot_press(mac_addr, name, password)])
  File "/config/custom_components/switchbot_press/switch.py", line 52, in __init__
    self._device = switchbot.Switchbot(mac=mac, password=password)
  File "/usr/local/lib/python3.10/site-packages/switchbot/devices/bot.py", line 25, in __init__
    super().__init__(*args, **kwargs)
TypeError: SwitchbotDevice.__init__() missing 1 required positional argument: 'device'

Any idea of what is wrong?

JimboJones3101 commented 2 years ago

Please ignore my issue.

Bluetooth was not working properly on my RPi3 which led to the error in first instance with the original integration. As this is now working I'm satisfied.

No need to invest more time in this errorsearch.

Nonetheless thanks for all your efforts of coding a HACS integration! Appreciate it!