How to use custom-card-helpers - 3 common examples

To help you get started, we’ve selected a few custom-card-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iantrich / list-card / src / list-card.ts View on Github external
protected updated(changedProps): void {
    super.updated(changedProps);
    if (!this._config || !this.hass) {
      return;
    }

    const oldHass = changedProps.get('hass') as HomeAssistant | undefined;
    const oldConfig = changedProps.get('_config') as ListCardConfig | undefined;

    if (!oldHass || !oldConfig || oldHass.themes !== this.hass.themes || oldConfig.theme !== this._config.theme) {
      applyThemesOnElement(this, this.hass.themes, this._config.theme);
    }
  }
github mishaaq / sun-card / src / editor.ts View on Github external
private _valueChanged(ev) {
    if (!this._config || !this.hass) {
      return;
    }
    const { target } = ev;
    if (this[`_${target.configValue}`] === target.value) {
      return;
    }
    if (target.configValue) {
      this._config = {
        ...this._config,
        [target.configValue]:
          target.checked !== undefined ? target.checked : target.value,
      };
    }
    fireEvent(this, 'config-changed', { config: this._config });
  }
github jonkristian / entur-card / src / entur-card.ts View on Github external
private _handleTap(): void {
    handleClick(this, this.hass!, this._config!, false, false);
  }

custom-card-helpers

Set of helpful functions and types for Custom Card creators

MIT
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis