-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT config entry #16594
MQTT config entry #16594
Conversation
tests/components/mqtt/test_init.py
Outdated
|
||
|
||
@asyncio.coroutine | ||
def test_setup_without_tls_config_uses_tlsv1_under_python36(hass): | ||
async def test_setup_without_tls_config_uses_tlsv1_under_python36(hass, mock_MQTT): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (83 > 79 characters)
tests/components/mqtt/test_init.py
Outdated
|
||
|
||
@asyncio.coroutine | ||
def test_setup_uses_certificate_on_certificate_set_to_auto(hass): | ||
async def test_setup_uses_certificate_on_certificate_set_to_auto(hass, mock_MQTT): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (82 > 79 characters)
certificate = os.path.join(os.path.dirname(__file__), | ||
'addtrustexternalcaroot.crt') | ||
'addtrustexternalcaroot.crt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line over-indented for visual indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Description:
This adds config entry support to MQTT. It's initially just limited to configuring just broker, port, username and password (last 2 are optional). I don't want to expose all advanced features, so this is a good start. Eventually I would want to add discovery, but that is little tricky as discovery requires access to the configuration.yaml.
This config entry takes a different approach than the other config entries: if a manual configuration is available, it will fail to setup the config entry. I'm actually not happy with that and will rework it, hence the WIP tag.It takes a slight different import to
import
than other config entries. Instead of absorbing the auth into an entry, it doesn't load anything and keeps loading from configuration.yaml. If the user removes configuration.yaml MQTT entry, the config entry will be removed.Once this PR is in, we can add support for Hass.io add-ons discovering MQTT config entry 👍
Depends on home-assistant/frontend#1662
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):# None! :-)
Checklist:
tox
. Your PR cannot be merged unless tests passIf the code does not interact with devices: