Closed ljmerza closed 5 years ago
I agree with you here, the sysinfo should really be cached and only functionality that depend on the outside state changes (e.g., fetching the state, settings or alias) should explicitly refresh the cache. I want to get the pending #151 merged before doing this change though.
I think this can be closed now, as #151 implements a TTL-based caching. In normal usecase the is_dimmable is likely to be queried only during the initialization among other features, so these should now cause only a single request on the device. Please let us know if that works for you!
Many properties get a device attribute by calling
self.is_dimmable
which in return queries the device. I think device capabilities should be cached on init of device as they wouldn't change.