Skip to content

RFC: remove implicit updates after state changes? #61

@rytilahti

Description

@rytilahti

It would make sense to avoid automatic await on update() after changing the device state, as this will create unnecessary I/O especially when changing multiple settings (e.g., turning the bulb on while adjusting its settings).

The question is, does it make sense to complicate the code by adding a device setting implicit_updates (or alike), that allows turning this behavior on if wanted?

The current API would be pretty clear without such:

  • All property accesses depend on update() to get the latest state. Property accesses do no I/O.
  • All state changes will likewise require update() to refresh the internal state. All coroutines do I/O operations.

What do you think?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions