Skip to content

Commit

Permalink
Support 0.106
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich committed Feb 20, 2020
1 parent e781740 commit a3cc0fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "radial-menu",
"version": "1.4.8",
"version": "1.4.9",
"description": "Lovelace radial-menu",
"keywords": [
"home-assistant",
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const CARD_VERSION = '1.4.8';
export const CARD_VERSION = '1.4.9';
9 changes: 8 additions & 1 deletion src/radial-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ console.info(
export class RadialMenu extends LitElement {
@property() public hass?: HomeAssistant;
@property() private _config?: RadialMenuConfig;
@property() private _helpers?: any;

public setConfig(config: RadialMenuConfig): void {
if (!config) {
Expand All @@ -41,6 +42,8 @@ export class RadialMenu extends LitElement {
default_dismiss: true,
...config,
};

this.loadCardHelpers();
}

public getCardSize(): number {
Expand All @@ -54,7 +57,7 @@ export class RadialMenu extends LitElement {

this._config.items.forEach(item => {
if (item.card) {
item.element = createThing(item.card);
item.element = this._helpers ? this._helpers.createEntityRow(item.card) : createThing(item.card);

if (item.element) {
item.element.hass = this.hass;
Expand Down Expand Up @@ -175,6 +178,10 @@ export class RadialMenu extends LitElement {
}
}

private async loadCardHelpers(): Promise<void> {
this._helpers = await (window as any).loadCardHelpers();
}

private _handleAction(ev): void {
const config = ev.target.config;

Expand Down

0 comments on commit a3cc0fe

Please sign in to comment.