Skip to content

Conversation

@allenporter
Copy link
Contributor

@allenporter allenporter commented Sep 13, 2025

Add a Do Not Disturb trait. This trait sends commands that change device state with data returned, which uncovers issues like:

  • there is a bug in from_dict with reusing variable names
  • Using as_dict to serialize the data has an issue adding additional timer fields that are moved to be properties

]


class DoNotDisturbTrait(Trait):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@allenporter allenporter marked this pull request as ready for review September 14, 2025 16:32
@allenporter allenporter merged commit cce1c1b into Python-roborock:main Sep 14, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants