Closed JarbasAl closed 1 year ago
I am not a fan of creating these type of function again in Python while NetworkManager can just report back all those different statuses.
If you ask NM the status of its connection it can report back the below;
| none | the host is not connected to any network. | | portal | the host is behind a captive portal and cannot reach the full Internet. | | limited | the host is connected to a network, but it has no access to the Internet. | | full | the host is connected to a network and has full access to the Internet. | | unknown | the connectivity status cannot be found out. |
as we already pull in the python-networkmanager package as requirement, I assume this can be used to ask network manager about its status. Then the OS/Distriution creators can setup which URL's to use for the check. Which they allready do.
which polls;
https://nmcheck.gnome.org/check_network_status.txt
But you could use any or we could even create our own. https://ping.archlinux.org/ http://checkonline.home-assistant.io/online.txt
Long story short: Don't re-invent the wheel in Python/Mycroft/Ovos but use the tools out there. (For me this is the same as OCP/MPRIS)
this should work in all platforms and can not depend on network manager ideally, however i do agree the connectivity events plugin should integrate better at platform level, maybe even use dbus directly
lets move this discussion to that plugin https://github.com/OpenVoiceOS/ovos-PHAL-plugin-connectivity-events
we should port check_captive_portal() and check_system_clock_sync_status()
https://github.com/MycroftAI/mycroft-core/blob/49616dcf1550c60c6b6082e226afa8d8bda664db/mycroft/util/network_utils.py#L123