Closed mikelawrence closed 6 years ago
I hadn't thought about this issue when I added the monitoring. I would be glad to take a PR. However, if we add your example here to every function it gets very long and a lot of repeated code. An internal functional _update_cache
seems like it would be a better approach.
A PR would be appreciated.
I believe this issue was fixed when you merged my PR #26.
When monitoring is enabled the cache is used to speed up status requests via get_attribute(). However when a property (i.e. brightness) is changed the cache is not updated until the next status update from the fan which could be 45 seconds later.
An example of why this is needed is Home Assistant automation software. It separates the command path from the status path. So when I turn on the fan in Home Assistant it takes upwards of 45 seconds before the on state of the fan is accurately reflected in Home Assistant.
I propose that the cache be updated along with any successful property change. Below is an example of changes to your brightness setter property:
I have made these changes already. Would like me to issue a Pull Request? I have never done a PR and may need some help.