Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Split out fastdotcom into a component and a sensor platform #20341
Per home-assistant/architecture#131, sensor platforms should not be registering services. Fast.com is one of several that does and this should be cleaned up. This sensor has a service call which is used to manually run a speedtest and them update the sensor with that information.
I moved all of the setup/service logic to a new Fast.com component and then used that component
Using a dispatcher signal, the component notifies the platform when it's finished a speedtest so the platform can update it's data.
Breaking Change: The Fast.com sensor platform has been separated into a component and a sensor to remove the service from the sensor platform. Configuration options have changed, please review the documentation and select the correct options.
Tests will not pass until #20526 is merged.
Example entry for
As pointed out in the architecture thread the update service in Fast.com (and the other 3 sensors) is redundant, since we have since the
On the other hand, if you really want to move the sensor into a component, might as well add the config_flow :)
I couldn't find a way to make that work for this component without running the speed test more frequently (whenever Home Assistant calls the entity update). By letting it run directly in the update method, it's going to use a lot more bandwidth.
The way the component is designed, it should only run speed tests at the frequency specified in the config and then on demand, if required.
Is there some way I'm missing that will allow that to work without a separate service?