Skip to content

Commit

Permalink
Restore alphabetical sorting to Areas (#19897)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored Feb 28, 2024
1 parent f4c932e commit ccdd906
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/data/ws-area_registry.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { Connection, createCollection } from "home-assistant-js-websocket";
import { Store } from "home-assistant-js-websocket/dist/store";
import { stringCompare } from "../common/string/compare";
import { debounce } from "../common/util/debounce";
import { AreaRegistryEntry } from "./area_registry";

const fetchAreaRegistry = (conn: Connection) =>
conn.sendMessagePromise<AreaRegistryEntry[]>({
type: "config/area_registry/list",
});
conn
.sendMessagePromise<AreaRegistryEntry[]>({
type: "config/area_registry/list",
})
.then((areas) =>
areas.sort((ent1, ent2) => stringCompare(ent1.name, ent2.name))
);

const subscribeAreaRegistryUpdates = (
conn: Connection,
Expand Down

0 comments on commit ccdd906

Please sign in to comment.