-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
WIP: Initial support for Vacuum 1C STYTJ01ZHM (dreame.vacuum.mc1808) #683
Conversation
* add miot_info() to get the common information from the device * this includes manufacturer, model, firmeware version and serial number * add get_properties_for_dataclass(cls) which allows easy implementation for get_properties mappings * each field() can define metadata containing siid and piid, these are mapped automatically to the response container * _siid can be used to define common siid, _max_properties can be used to set number of maximum properties per request * get_properties_for_mapping() requires explicit passing of the mapping, no more passing over __init__
* rename old set_property to set_property_from_mapping * add set_properties_from_dataclass (allows passing a mapping object with all wanted values at once) ``` device.set_properties_from_dataclass(GosundPlugStatus(state=True, some_other_property=123) ``` * new set_property helper which takes kwargs that are used automatically with the help of the class-given _MAPPING: ``` device.set_property(state=True) ```
this is just a poc to show how the new api could function
partially autogenerated based on the spec file, so things may or may not work, so use at your own risk. in its current state it is more or less just for testing. Fixes #669
requests are using 'get_prop' but should be 'get_properties' |
Start Resume to charge |
… on unfetchable properties * Changes the property getter (get_prop for miio, get_properties for miot) * The properties that were not properly fetched are now returned instead of crashing completely * useful for setting _max_properties=1 for debugging to see which properties are available
hello, what syntax should a use for start_remote please ? X and Y ? |
start_remote will just start the modus without additional variables |
thanks you |
this is working well. thank you for your work. |
@rytilahti would you mind to explain how the commands are working. |
Do you have something specific you are interested in? The code itself bases on the metadata files that are available on the internet (#543 (comment)) which are parsed using the script found under The PR linked on the issue description (#672) which this bases on has some todo items. For example, the manual controls on this device are done using writing the properties of the service with siid 21 (https://github.com/rytilahti/python-miio/pull/683/files#diff-1d60d6cac3e7d3a87e527874901056afR195). About setting properties, the API is not yet there, but you can get an idea if you take a look at https://github.com/rytilahti/python-miio/pull/672/files#diff-917e6e7e59bfa94f83c5923372d51a4dR32 . The
For actions, the service id and action id are also obtained from the description file. |
Thanks for the info From what i can make out for each action requires a call to I was attempting to change the fan speed with something like the following: |
Where did you get the siid 6, aiid 2 for the call? Anyways, if you look at the description file, the fan speed is a property as I mentioned above. Did you try that So maybe something like this could work?
and calling like |
I think i have a clearer picture now of how this works. Thanks again for explaining |
Ah, indeed, I didn't recall that API is not yet complete, sorry for that. To make it work, all the field definitions need to be modified to default to some value. So
needs to become
and so on for each and every field. This is related to the TODO item |
I had to add the |
So there are two things that needs to be done until I'm satisfied to get this out:
|
Hello, stupid question, is it already possible to install this on home assistant ? |
@rytilahti I'm new to this repo, but have both Home Assistant as a Vacuum 1c. Is there anything I can do to help? I've just created a simple cli file, based on the vacuum_cli, but a lot of commands are still missing. |
@SLG see my previous comment (the link). We are going to need an abstract interface (or interfaces, the status containers should also have a common base) that exposes the common functionality of all current (and potential future) implementations. The vacuum implementations will implement this interface and we can simply use the common interface in homeassistant (or cli) to provide some basic functionality using that interface. |
does anyone has a working fork for just this vacuum? |
https://github.com/Concentricc/xiaomi_vacuum |
great!!! Thank you! I'll have a look :) |
+1 |
This has been obsoleted by #952. |
Partially autogenerated based on the spec file, so things may or may not work,
so use at your own risk. in its current state it is more or less just for testing.
Fixes #669 when its ready.
This based itself on #672, so it should be merged first when the time comes.