AdyRock / com.ady.button_plus

GNU General Public License v3.0
2 stars 3 forks source link

Reduce API calls on configuration page #64

Closed vincent8balls closed 9 months ago

vincent8balls commented 10 months ago

Currently the app is doing multiple requests to the Devices endpoint of Homey. This makes the settings page slower.

This can be reduced to a single function, and filter out the capabilities instead. For example:

        function getDevices(devices, type) {
            if(type == 'button') {
                devices.filter(device => device.capabilities.includes('on_off') || device.capabilities.includes('dim'));
            }

            return devices;
        }
AdyRock commented 9 months ago

Your pull requests have been incorporated in the latest test version.