Skip to content
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

Add persistent notifications to bootstrap #3738

Merged
merged 2 commits into from Oct 13, 2016
Merged

Conversation

kellerza
Copy link
Member

@kellerza kellerza commented Oct 6, 2016

Description:
#3555 - During startup of Home Assistant, if we experience a configuration validation error, capture the message and add it as a persistent notification. That way the user will be notified in the UI that not all components initialized.

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

light:
 - platform: beer
sensor:
 - platform: template
   some_bad_value: 1

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link

@kellerza, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabianhjr and @persandstrom to be potential reviewers.

', '.join(list(_PERSISTENT_PLATFORMS)) +
'(please check your configuration)')
persistent_notification.create(
hass, message, 'Invalid platforms', 'platform_errors')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By passing in an id you will overwrite the previous message with that id.

', '.join(list(_PERSISTENT_VALIDATION)) +
' (please check your configuration)')
persistent_notification.create(
hass, message, 'Invalid config', 'invalid_config')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By passing in an id you will overwrite the previous message with that id.

Copy link
Member Author

@kellerza kellerza Oct 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding many cards with one error each, the messages lists them. There will be 2 type of messages:


Invalid platforms

Unable to find the following platforms: sensor.forecast, sensor.loch_ness_monster (please check your configuration)


Invalid config

The following platforms_components_ contain invalid configuration: sensor, light (please check your configuration)


@balloob
Copy link
Member

balloob commented Oct 13, 2016

You are right, I did not see the sets. Not a big fan of dirty globals but it is ok for now.

@balloob
Copy link
Member

balloob commented Oct 13, 2016

🐬

@balloob balloob merged commit cb322f7 into home-assistant:dev Oct 13, 2016
@kellerza kellerza deleted the notify branch October 28, 2016 21:58
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
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.

None yet

4 participants