feat: Add a DnD trait and fix bugs in the rpc channels#471
feat: Add a DnD trait and fix bugs in the rpc channels#471allenporter merged 3 commits intoPython-roborock:mainfrom
Conversation
| ] | ||
|
|
||
|
|
||
| class DoNotDisturbTrait(Trait): |
There was a problem hiding this comment.
Zooming out a bit, where do you see the data from get dnd timer being stored? In the device object? Still in the trait somehow?
There was a problem hiding this comment.
I don't know yet?
My thinking is on this next step is: the current set of commands isn't complex enough to have any real use cases, so I want to start adding them in. The whole trait syntax is not good yet, and needs to be rewritten, with a few examples. I was only thinking in the context of adding traits to the CLI for now.
One question i'm wondering if is if data needs to be stored at all here? but yeah i think it probably will.
There was a problem hiding this comment.
I think we will need data stored somewhere for simplicity, but i'm open to other solutions.
There could be cases where one trait has multiple entities relying on it, so we don't want to call update() for each entity.
But 100% fine with what you're saying for now, fine with punting this down the road.
Add a Do Not Disturb trait. This trait sends commands that change device state with data returned, which uncovers issues like:
from_dictwith reusing variable namesas_dictto serialize the data has an issue adding additional timer fields that are moved to be properties