Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
[x] I have read the README.md file and visited the Documentation to see if the information there helps.
Describe the bug
Updated from v0.5.6 version to 2.2.6 and now I'm having error using pcf8574 module: KeyError: <PinPUD.OFF: 1>
After little digging found that there is new default pud state PinPUD.OFF previously default state was None.
In a result of that pcf8574 modules pullup_map lacks of this value map.
I believe changing it to self.pullup_map = {PinPUD.OFF: None, PinPUD.UP: True, PinPUD.DOWN: False} would fix the issue.
Expected behavior
Do not use pullup/pulldown if it is not necessary and run mqtt-io server without errors as it is supposed to be handled at this line.
Error messages and traceback
mqtt-io | Traceback (most recent call last):
mqtt-io | File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
mqtt-io | return _run_code(code, main_globals, None,
mqtt-io | File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
mqtt-io | exec(code, run_globals)
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/__main__.py", line 85, in <module>
mqtt-io | main()
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/__main__.py", line 80, in main
mqtt-io | mqtt_gpio.run()
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/server.py", line 1168, in run
mqtt-io | self._init_digital_inputs()
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/server.py", line 386, in _init_digital_inputs
mqtt-io | gpio_module.setup_pin_internal(PinDirection.INPUT, in_conf)
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/modules/gpio/__init__.py", line 207, in setup_pin_internal
mqtt-io | return self.setup_pin(
mqtt-io | File "/home/mqttio/.local/lib/python3.9/site-packages/mqtt_io/modules/gpio/pcf8574.py", line 39, in setup_pin
mqtt-io | self.io.port[pin] = self.pullup_map[pullup]
mqtt-io | KeyError: <PinPUD.OFF: 1>
Describe the bug Updated from v0.5.6 version to 2.2.6 and now I'm having error using pcf8574 module:
KeyError: <PinPUD.OFF: 1>
After little digging found that there is new default pud state PinPUD.OFF previously default state was None. In a result of that pcf8574 modules pullup_map lacks of this value map. I believe changing it toself.pullup_map = {PinPUD.OFF: None, PinPUD.UP: True, PinPUD.DOWN: False}
would fix the issue.Expected behavior Do not use pullup/pulldown if it is not necessary and run mqtt-io server without errors as it is supposed to be handled at this line.
Error messages and traceback
Config
Hardware
System:
Additional context