Skip to content

Fix hangouts#16180

Merged
balloob merged 1 commit intodevfrom
hangouts-quick-fix
Aug 25, 2018
Merged

Fix hangouts#16180
balloob merged 1 commit intodevfrom
hangouts-quick-fix

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Aug 24, 2018

Description:

Two quick fixes:

  • the import config flow triggered from async_setup should not just abort, why even abort in the first place 🤔 instead it should start a flow so users know to use UI to configure it
  • default config needs to be a dict as that's how it's used later (trying to get key)

Missed a few review things here I guess. Also a CONFIG_SCHEMA Is missing to validate the commands.

CC @hobbypunk90

@balloob balloob added this to the 0.77 milestone Aug 24, 2018
@ghost ghost assigned balloob Aug 24, 2018
@ghost ghost added the in progress label Aug 24, 2018
@hobbypunk90
Copy link
Copy Markdown
Contributor

what do you mean, that a CONFIG_SCHEMA for commands is missing?
in const.py there is a COMMAND_SCHEMA which is used to validate the command. i thought that is it?

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Aug 25, 2018

CONFIG_SCHEMA is what Home Assistant uses to validate configuration.yaml entries.

@balloob balloob merged commit 456aa5a into dev Aug 25, 2018
@ghost ghost removed the in progress label Aug 25, 2018
@balloob balloob deleted the hangouts-quick-fix branch August 25, 2018 09:01
@hobbypunk90
Copy link
Copy Markdown
Contributor

yes, i know, thats why i'm struggling 😁

COMMAND_SCHEMA = vol.All(
    # Basic Schema
    vol.Schema({
        vol.Exclusive(CONF_WORD, 'trigger'): cv.string,
        vol.Exclusive(CONF_EXPRESSION, 'trigger'): cv.is_regex,
        vol.Required(CONF_NAME): cv.string,
        vol.Optional(CONF_CONVERSATIONS): [TARGETS_SCHEMA]
    }),
    # Make sure it's either a word or an expression command
    cv.has_at_least_one_key(CONF_WORD, CONF_EXPRESSION)
)

CONFIG_SCHEMA = vol.Schema({
    DOMAIN: vol.Schema({
        vol.Optional(CONF_COMMANDS, default=[]): [COMMAND_SCHEMA]
    })
}, extra=vol.ALLOW_EXTRA)

i'm not sure what is missing here

balloob added a commit that referenced this pull request Aug 25, 2018
@balloob balloob mentioned this pull request Aug 29, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants