Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/panels/config/automation/ha-config-automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,7 @@ class HaConfigAutomation extends PolymerElement {
}
});

return automations.sort(function entitySortBy(entityA, entityB) {
var nameA = (entityA.attributes.alias || entityA.entity_id).toLowerCase();
var nameB = (entityB.attributes.alias || entityB.entity_id).toLowerCase();

if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});
return automations;
}

computeShowEditor(_edittingAutomation, _creatingNew) {
Expand Down
12 changes: 1 addition & 11 deletions src/panels/config/scene/ha-config-scene.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import "@polymer/app-route/app-route";

import "./ha-scene-editor";
import "./ha-scene-dashboard";

Expand All @@ -10,8 +8,6 @@ import {
import { property, customElement, PropertyValues } from "lit-element";
import { HomeAssistant } from "../../../types";
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
import { computeStateName } from "../../../common/entity/compute_state_name";
import { compare } from "../../../common/string/compare";
import { SceneEntity } from "../../../data/scene";
import memoizeOne from "memoize-one";
import { HassEntities } from "home-assistant-js-websocket";
Expand Down Expand Up @@ -45,15 +41,9 @@ class HaConfigScene extends HassRouterPage {
}
});

return scenes.sort((a, b) => {
return compare(computeStateName(a), computeStateName(b));
});
return scenes;
});

public disconnectedCallback() {
super.disconnectedCallback();
}

protected updatePageEl(pageEl, changedProps: PropertyValues) {
pageEl.hass = this.hass;
pageEl.narrow = this.narrow;
Expand Down
14 changes: 1 addition & 13 deletions src/panels/config/script/ha-config-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
import "./ha-script-editor";
import "./ha-script-picker";

import { computeStateName } from "../../../common/entity/compute_state_name";
import { computeStateDomain } from "../../../common/entity/compute_state_domain";

class HaConfigScript extends PolymerElement {
Expand Down Expand Up @@ -103,18 +102,7 @@ class HaConfigScript extends PolymerElement {
}
});

return scripts.sort(function entitySortBy(entityA, entityB) {
var nameA = computeStateName(entityA);
var nameB = computeStateName(entityB);

if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});
return scripts;
}

computeShowEditor(_edittingScript, _creatingNew) {
Expand Down