I’m currently developing a device tracker platform for the Freebox, the server/router of the french FAI Free, along the lines of PR #10702 (sorry, cannot post more than two links). I have a working version based on freepybox, but I’m waiting for some pull requests to be merged in this project. In the meantime, I have a few questions:
The Freebox requires a manual intervention from the user to authorize applications, pretty much like the Hue bridge does: the first time an application requests access to the server, the user must authorize it directly on the device. What would be the correct way to handle this? Do I need to make a custom component so that the user can configure the access from the home page, as is done for Hue for instance, or is it acceptable to simply give instructions in the documentation (for starters)?
I have made a second version that automatically setup the device tracker through discovery. Is it something desirable? Device tracking can be seen as a bit intrusive, is it a good idea to start doing it without user intervention? If not, what would be the correct approach to notify the user that we discovered a Freebox device, along with the host and port to use in her configuration file if she wishes to set it up?
Just to be sure I understand correctly how to implement a device tracker:
get_scannercan be used to return a “simple” scanner that provides one method to get the list of current devices, and one method to get the name of a specific device. These methods are called automatically by another service that takes care of honoring
interval_seconds. However, this approach cannot handle discovery. On the other hand, it is also possible to implement
setup_scanner, which is passed either the config coming from the configuration.yaml (explicit configuration) or the discovery info (automatic configuration). When implementing
setup_scanner, we are responsible for scheduling the refresh of devices, taking into account
interval_secondsand using the
seecallback passed as an argument. Is all that correct? Do I need to handle
track, etc., or are they handled by the
If anyone is interested, I have pushed my WIP on my HASS fork. Perhaps it would be best to create a pull request to initiate discussion rather than asking questions here? I’m not sure what is the appropriate workflow