house-of-abbey / GarminHomeAssistant

Garmin application to provide a dashboard to control your Home Assistant
https://community.home-assistant.io/t/home-assistant-app-for-garmin/637348
MIT License
79 stars 12 forks source link

Cache 'has' results #74

Closed philipabbey closed 8 months ago

philipabbey commented 8 months ago

memory storage and widget suggests that has is an expensive operation and to perform the check once in initialize() and store the boolean as a member variable for the future.

We use has in several places where it is called repeated. Suggest we need to make a similar change.