Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: get_connected_client() got an unexpected keyword argument 'verbose' #74

Closed
CarstenGrohmann opened this issue Jul 24, 2023 · 1 comment

Comments

@CarstenGrohmann
Copy link

Hi Jens,

during testing the MQTT connection with `` I get this traceback:

spower@rpi4:~/inverter-connect $ ./cli.py test-mqtt-connection 

+ /home/spower/inverter-connect/.venv-app/bin/inverter_app test-mqtt-connection

Use user settings file: /home/spower/.config/inverter-connect/inverter-connect.toml.read, ok.
inverter v0.11.1
                                                            (Set log level 0: ERROR)
╭─────────────────────── Traceback (most recent call last) ────────────────────────╮
│ /home/spower/inverter-connect/.venv-app/bin/inverter_app:8 in <module>           │
│                                                                                  │
│   5 from inverter.__main__ import main                                           │
│   6 if __name__ == '__main__':                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])         │
│ ❱ 8 │   sys.exit(main())                                                         │
│   9                                                                              │
│                                                                                  │
│ ╭─────────────────────── locals ───────────────────────╮                         │
│ │ main = <function main at 0x7fbb273310>               │                         │
│ │   re = <module 're' from '/usr/lib/python3.9/re.py'> │                         │
│ │  sys = <module 'sys' (built-in)>                     │                         │
│ ╰──────────────────────────────────────────────────────╯                         │
│                                                                                  │
│ /home/spower/inverter-connect/inverter/__main__.py:11 in main                    │
│                                                                                  │
│    8                                                                             │
│    9                                                                             │
│   10 def main():                                                                 │
│ ❱ 11 │   cli_app.main()                                                          │
│   12                                                                             │
│   13                                                                             │
│   14 if __name__ == '__main__':                                                  │
│                                                                                  │
│                             ... 6 frames hidden ...                              │
│                                                                                  │
│ /home/spower/inverter-connect/.venv-app/lib/python3.9/site-packages/click/core.p │
│ y:783 in invoke                                                                  │
│                                                                                  │
│    780 │   │                                                                     │
│    781 │   │   with augment_usage_errors(__self):                                │
│    782 │   │   │   with ctx:                                                     │
│ ❱  783 │   │   │   │   return __callback(*args, **kwargs)                        │
│    784 │                                                                         │
│    785 │   def forward(                                                          │
│    786 │   │   __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any  # noqa:  │
│                                                                                  │
│ ╭─────────────────────────────── locals ───────────────────────────────╮         │
│ │ _Context__callback = <function test_mqtt_connection at 0x7fb9f7d1f0> │         │
│ │     _Context__self = <click.core.Context object at 0x7fb9fc76a0>     │         │
│ │               args = ()                                              │         │
│ │                ctx = <click.core.Context object at 0x7fb9fc76a0>     │         │
│ │             kwargs = {'verbosity': 0}                                │         │
│ ╰──────────────────────────────────────────────────────────────────────╯         │
│                                                                                  │
│ /home/spower/inverter-connect/inverter/cli/cli_app.py:553 in                     │
│ test_mqtt_connection                                                             │
│                                                                                  │
│   550 │                                                                          │
│   551 │   setup_logging(verbosity=verbosity)                                     │
│   552 │                                                                          │
│ ❱ 553 │   mqttc = get_connected_client(settings=user_settings.mqtt, verbose=True │
│   554 │   mqttc.loop_start()                                                     │
│   555 │   mqttc.loop_stop()                                                      │
│   556 │   mqttc.disconnect()                                                     │
│                                                                                  │
│ ╭─── locals ────╮                                                                │
│ │ verbosity = 0 │                                                                │
│ ╰───────────────╯                                                                │
╰──────────────────────────────────────────────────────────────────────────────────╯
TypeError: get_connected_client() got an unexpected keyword argument 'verbose'
──────────────────────────── Mon 24 Jul 2023 20:33:10  ─────────────────────────────

It looks like the signature of get_connected_client() differs.

Possibly changing

mqttc = get_connected_client(settings=user_settings.mqtt, verbose=True)
to

mqttc = get_connected_client(settings=user_settings.mqtt, verbosity=1)

solves this issue.

Regards,
Carsten

jedie added a commit that referenced this issue Aug 8, 2023
jedie added a commit that referenced this issue Aug 8, 2023
Bugfix #74 "test-mqtt-connection"
@jedie
Copy link
Owner

jedie commented Aug 8, 2023

Yes, overseen refactoring. Fixed by #85

@jedie jedie closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants