jblance/mpp-solar

powermon doen't read command_definitions from specific protocol files

StevenHodl opened this issue · 1 comments

Hello everyone,

I submitted this conf.yaml file to powermon:

device:                    # required, but will create a test device with protocol PI30 if missing
  name: EAsun 8kw         # required, defaults to "unnamed_device" if not supplied
  port:                    # required
    type: usb          # for use with direct usb connections
    path: /dev/hidraw0 # required, defaults to '/dev/hidraw0' if not supplied
    baud: 2400
    protocol: PI30MAX

commands:
- command: QPI

when I run command "powermon -C config.yaml" I get the following runtime error:

2024-01-02 16:09:28,891:ERROR:device:add_command@64: Cannot find command code: QPI, in protocol: b'PI30MAX' Traceback (most recent call last): File "/home/pi/.venv/bin/powermon", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/pi/.venv/lib/python3.11/site-packages/powermon/__init__.py", line 166, in main device.add_command(Command.from_config(command_config)) File "/home/pi/.venv/lib/python3.11/site-packages/powermon/device.py", line 65, in add_command raise RuntimeError(f"Invalid command code: {command.code}, in protocol: {self.port.protocol.get_protocol_id()}") RuntimeError: Invalid command code: QPI, in protocol: b'PI30MAX'

yep, powermon is broken at the moment, and under continuous development so not ready for real use