-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
viomivacuum doesn´t work with -o json_pretty #816
Labels
Comments
This is happening because ViomiVacuumStatus does not have |
@rytilahti |
@fs79 feel free to create a PR :-) |
rytilahti
added a commit
that referenced
this issue
Oct 3, 2020
All implementations were simply returning the `data` for this request, and forgetting to add this boilerplate piece causes problems like shown in #816. This commit adds a lookup for `data` variable which should be consistent within all containers. For the time being, this behavior can still be overridden by manually defining __json__. Fixes #816
rytilahti
added a commit
that referenced
this issue
Oct 3, 2020
All implementations were simply returning the `data` for this request, and forgetting to add this boilerplate piece causes problems like shown in #816. This commit adds a lookup for `data` variable which should be consistent within all containers. For the time being, this behavior can still be overridden by manually defining __json__. Fixes #816
swim2sun
pushed a commit
to swim2sun/python-miio
that referenced
this issue
Oct 13, 2020
…i#827) All implementations were simply returning the `data` for this request, and forgetting to add this boilerplate piece causes problems like shown in rytilahti#816. This commit adds a lookup for `data` variable which should be consistent within all containers. For the time being, this behavior can still be overridden by manually defining __json__. Fixes rytilahti#816
xvlady
pushed a commit
to xvlady/python-miio
that referenced
this issue
May 9, 2021
…i#827) All implementations were simply returning the `data` for this request, and forgetting to add this boilerplate piece causes problems like shown in rytilahti#816. This commit adds a lookup for `data` variable which should be consistent within all containers. For the time being, this behavior can still be overridden by manually defining __json__. Fixes rytilahti#816
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/miiocli -o json_pretty viomivacuum --ip x.x.x.x --token x1234567890x status
doesn´t work.
/miiocli viomivacuum --ip x.x.x.x --token x1234567890x status
Device information:
It doesn´t work for the devicetype "viomivacuum".
Steps to reproduce the behavior:
Expected behavior
Should work, the same as for type "vacuum"
Console output
root@loxb01:~# /usr/local/bin/miiocli -o json_pretty viomivacuum --ip x.x.x.x --token x1234567890x status
Traceback (most recent call last):
File "/usr/local/bin/miiocli", line 8, in
sys.exit(create_cli())
File "/usr/local/lib/python3.7/dist-packages/miio/cli.py", line 45, in create_cli
return cli(auto_envvar_prefix="MIIO")
File "/usr/local/lib/python3.7/dist-packages/miio/click_common.py", line 59, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/miio/click_common.py", line 309, in wrap
click.echo(json.dumps(result, indent=indent))
File "/usr/lib/python3.7/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python3.7/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/usr/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name}
TypeError: Object of type ViomiVacuumStatus is not JSON serializable
The text was updated successfully, but these errors were encountered: