__init__() takes 2 positional arguments but 3 were given
See original GitHub issueI’ve just tried installing on a RPi 3B+ running Ubuntu Server 18.04.3 from here. Following the instructions for installation of bt-mqtt-gateway, I encounter the issue shown below:
(.venv) ubuntu@ubuntu:~/bt-mqtt-gateway$ sudo ./gateway.py -d 2019-10-16 10:27:29,252 INFO bt-mqtt-gw gateway.py:61:<module> - Starting 2019-10-16 10:27:29,254 DEBUG bt-mqtt-gw.mqtt mqtt.py:30:init - Setting LWT to: lwt_topic 2019-10-16 10:27:29,592 INFO bt-mqtt-gw.workers.miflora miflora.py:23:_setup - Adding 11 miflora devices 2019-10-16 10:27:29,592 DEBUG bt-mqtt-gw.workers.miflora miflora.py:25:_setup - Adding miflora device ‘rosemary’ (C4:7C:8D:66:2F:D0) Traceback (most recent call last): File “./gateway.py”, line 67, in <module> manager.register_workers(global_topic_prefix).start(mqtt) File “/home/ubuntu/bt-mqtt-gateway/workers_manager.py”, line 88, in register_workers command_timeout, global_topic_prefix, **worker_config[“args”] File “/home/ubuntu/bt-mqtt-gateway/workers/base.py”, line 7, in init self._setup() File “/home/ubuntu/bt-mqtt-gateway/workers/miflora.py”, line 28, in _setup “poller”: MiFloraPoller(mac, BluepyBackend), File “/usr/local/lib/python3.6/dist-packages/miflora/miflora_poller.py”, line 37, in init self._bt_interface = BluetoothInterface(backend, adapter) TypeError: init() takes 2 positional arguments but 3 were given
My config is the same as what I had running and working on an Intel NUC running Ubuntu server, so it shouldn’t be an issue with my config:
mqtt:
host: 192.168.1.135
port: 1883
username: username
password: password
#ca_cert: /etc/ssl/certs/ca-certificates.crt # Uncomment to enable MQTT TLS, update path to appropriate location.
#ca_verify: False # Verify TLS certificate chain and host, disable for testing with self-signed certi$
#topic_prefix: homeassistant # All messages will have that prefix added, remove if you dont need this.
client_id: bt-mqtt-gateway
availability_topic: lwt_topic
manager:
sensor_config:
topic: homeassistant
retain: true
topic_subscription:
update_all:
topic: homeassistant/status
payload: online
command_timeout: 35 # Timeout for worker operations. Can be removed if the default of 35 seconds is suff$
workers:
miflora:
args:
devices:
rosemary: C4:7C:8D:66:2F:D0
oregano: C4:7C:8D:66:35:6B
mint: C4:7C:8D:66:2E:97
thyme: C4:7C:8D:6A:15:29
curry: C4:7C:8D:6A:A3:B3
perennial_basil: C4:7C:8D:66:2D:79
sweet_basil_and_habanero_orange_chilli: C4:7C:8D:66:36:D2
asian_siam_yellow_chilli: C4:7C:8D:6A:09:2D
tabasco_red_chilli: C4:7C:8D:6A:05:27
garlic_chives: C4:7C:8D:6B:26:75
happy_plant: C4:7C:8D:6A:8E:0E
topic_prefix: miflora
update_interval: 60
Not sure what has gone wrong, please help!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
I’ve pushed fixes with fixed btlewrap version
Hello,
Problem maj miflora 0.5. Thé cause = btlewrap == 0.0.8. https://github.com/zewelor/bt-mqtt-gateway/issues/109
the problem after rebooting the new version (btlewrap) is reinstalled.