Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

node_id = mac.replace(":", "-") = AttributeError: 'dict' object has no attribute 'replace' #246

Open
bob-walpole opened this issue Jan 26, 2022 · 1 comment

Comments

@bob-walpole
Copy link

[] I've read the Troubleshooting Wiki, my problem is not described there and I am already using the specified minimum bluez version.

Describe the bug

When using mithermometer in config.yaml I get this error at startup :_

node_id = mac.replace(":", "-") = AttributeError: 'dict' object has no attribute 'replace'

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Config
Used config

Debug gateway logs
run gateway.py with -d switch and paste formatted output log

Traceback (most recent call last):
File "/home/pi/bt-mqtt-gateway/./gateway.py", line 84, in
manager.start()
File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 156, in start
self._publish_config()
File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 210, in _publish_config
messages = command.execute()
File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 48, in execute
messages = self._callback(*self._args)
File "/home/pi/bt-mqtt-gateway/workers/miflora.py", line 42, in config
ret += self.config_device(name, data["mac"])
File "/home/pi/bt-mqtt-gateway/workers/miflora.py", line 48, in config_device
"identifiers": [mac, self.format_discovery_id(mac, name)],
File "/home/pi/bt-mqtt-gateway/workers/base.py", line 31, in format_discovery_id
self.format_discovery_topic(mac, *sensor_args)
File "/home/pi/bt-mqtt-gateway/workers/base.py", line 25, in format_discovery_topic
node_id = mac.replace(":", "-")
AttributeError: 'dict' object has no attribute 'replace'

Server (please complete the following information):

  • OS: Linux
  • Distro: Raspbian
  • Version 5.10.63-v7+

5.10.63-v7+ #1488 SMP Thu Nov 18 16:14:44 GMT 2021 armv7l

Additional context
Add any other context about the problem here.

@bob-walpole
Copy link
Author

I fixed this problem by using a revised device type in config.yaml

lywsd03mmc:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant