Skip to content

Commit

Permalink
fix: rename ha-bar to cu-bar to avoid duplicate registration
Browse files Browse the repository at this point in the history
  • Loading branch information
itsteddyyo committed Oct 4, 2024
1 parent 1425ac6 commit efe3897
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/consumable-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { classMap } from "lit/directives/class-map.js";
import { mdiRestore } from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
import { C_HomeAssistant } from "./util/types";
import "./homeassistant/ha-bar";
import "./homeassistant/cu-bar";

interface ConsumableConfig {
title: string;
Expand Down Expand Up @@ -72,15 +72,15 @@ class ConsumableFeature extends LitElement {
return html`
<ha-control-button-group>
<span class="secondary">${this.config.config.title}</span>
<ha-bar
<cu-bar
class=${classMap({
warning: currentValue < warningValue,
error: currentValue < errorValue,
})}
.value=${currentValue}
.min=${minValue}
.max=${maxValue}
></ha-bar>
></cu-bar>
<ha-control-button
key=${this.config.config.resetEntity}
@click=${this._reset}
Expand Down
6 changes: 3 additions & 3 deletions src/homeassistant/ha-bar.ts → src/homeassistant/cu-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { css, CSSResultGroup, LitElement, svg, TemplateResult } from "lit";
import { customElement, property } from "lit/decorators.js";
import { getValueInPercentage, normalize, roundWithOneDecimal } from "./calculate";

@customElement("ha-bar")
export class HaBar extends LitElement {
@customElement("cu-bar")
export class CuBar extends LitElement {
@property({ type: Number }) public min = 0;

@property({ type: Number }) public max = 100;
Expand Down Expand Up @@ -46,6 +46,6 @@ export class HaBar extends LitElement {

declare global {
interface HTMLElementTagNameMap {
"ha-bar": HaBar;
"cu-bar": CuBar;
}
}

0 comments on commit efe3897

Please sign in to comment.