Skip to content

Sort list of available events#4895

Merged
bramkragten merged 2 commits into
home-assistant:devfrom
scop:sort-available-events
Feb 17, 2020
Merged

Sort list of available events#4895
bramkragten merged 2 commits into
home-assistant:devfrom
scop:sort-available-events

Conversation

@scop
Copy link
Copy Markdown
Member

@scop scop commented Feb 16, 2020

Proposed change

The list of available events in developer tools is apparently not sorted. Here's a crack at it, completely untested and I don't really know what I'm doing here :)

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

this.hass.callApi("GET", "events").then(
function(events) {
this.events = events;
this.events = events.sort((e1, e2) => compare(e1.event, e2.event));
Copy link
Copy Markdown
Member

@bramkragten bramkragten Feb 17, 2020

Choose a reason for hiding this comment

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

You have to import compare from /src/common/string/compare.ts

@bramkragten bramkragten merged commit 52ea3a5 into home-assistant:dev Feb 17, 2020
@scop scop deleted the sort-available-events branch February 17, 2020 21:14
@bramkragten bramkragten mentioned this pull request Feb 19, 2020
@lock lock Bot locked and limited conversation to collaborators Feb 21, 2020
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