Skip to content

Commit

Permalink
Merge pull request #135 from Olen/2024.9.0
Browse files Browse the repository at this point in the history
2024.9.0-beta1
  • Loading branch information
Olen authored Sep 21, 2024
2 parents eb383ef + 4f208ef commit fd94862
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flower-card",
"version": "2024.9.0-beta2",
"version": "2024.9.0-beta1",
"description": "Custom flower card for https://github.com/Olen/homeassistant-plant",
"keywords": [
"home-assistant",
Expand All @@ -19,7 +19,7 @@
"lit": "^2.8.0",
"lit-element": "^3.3.3",
"lit-html": "^2.8.0",
"webpack": "^5.88.2",
"webpack": ">=5.94.0",
"yarn": "^1.22.19"
},
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { DisplayType } from "./types/flower-card-types";
import { default_show_bars, plantAttributes } from "./utils/constants";
import EditorForm from "@marcokreeft/ha-editor-formbuilder";
import { FormControlType } from "@marcokreeft/ha-editor-formbuilder/dist/interfaces";
import { getEntitiesByDomain } from "@marcokreeft/ha-editor-formbuilder/dist/utils/entities";
import { getEntitiesByDeviceClass } from "@marcokreeft/ha-editor-formbuilder/dist/utils/entities";

@customElement('flower-card-editor')
export class FlowerCardEditor extends EditorForm {
Expand All @@ -17,8 +19,8 @@ export class FlowerCardEditor extends EditorForm {
this._config.show_bars = default_show_bars;
}

const plantsList = this.getEntitiesByDomain('plant');
const batteryList = this.getEntitiesByDeviceClass("sensor", "battery");
const plantsList = getEntitiesByDomain('plant');
const batteryList = getEntitiesByDeviceClass("sensor", "battery");

return this.renderForm([
{ controls: [{ label: "Display Type", configValue: "display_type", type: FormControlType.Radio, items: [
Expand All @@ -30,4 +32,4 @@ export class FlowerCardEditor extends EditorForm {
{ controls: [{ label: "Show Bars", configValue: "show_bars", type: FormControlType.Checkboxes, items: plantAttributes }] }
]);
}
}
}

0 comments on commit fd94862

Please sign in to comment.