MycroftAI / skill-homeassistant

Mycroft Skill/Integration for Homeassistant
GNU Lesser General Public License v3.0
114 stars 62 forks source link

Bugfix - Skill fails on first run when settings not yet defined #56

Closed krisgesling closed 3 years ago

krisgesling commented 3 years ago

Restructure Skill initialization to handle the first run of the Skill when settings haven't yet been entered by the user.

on_websettings_changed() now creates the HA client, and settings fetching got moved here to ensure settings get updated in Skill when changed remotely. Removed default settings values from the settings.get() methods to rely on the default values in settingsmeta. This means they will only need to be updated in one location. If the settings aren't available we do not know which host to connect to anyway. Also added some settings validation and error messages for common failure scenarios.