I am making a weather sensor integration app for Homey. Sensors use Bluetooth Low Energy (BLE) to communicate with Homey.
The problem is that Homey.ManagerBLE.discover() and Homey.ManagerBLE.find() both return cached advertisements and do not refresh them in a reasonable time (several minutes at max).
It is crucial for the advertisements to be refreshed every time Homey discovers them from the sensors in my app, as the sensor BLE advertisement contains data about current sensor state (calibrating, updating firmware, disabled integration, etc.) and availability to be connected to.
Restarting the app seems to be one way to clear cached advertisements and after that the next discover returns fresh advertisements, but is not an appropriate solution to the problem.
So my question is:
- Is there a way to clear app cache or get fresh advertisements from BLE device?
Thank you in advance.