mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 11:56:34 +00:00
* Fixes and cleanup * Rename function to genHassioIcons * Update
This commit is contained in:
parent
cd33e2568a
commit
21dcbb3b9d
@ -5,9 +5,11 @@ const {
|
|||||||
generateIconset,
|
generateIconset,
|
||||||
} = require('../../gulp/tasks/gen-icons.js');
|
} = require('../../gulp/tasks/gen-icons.js');
|
||||||
|
|
||||||
function genHassIcons() {
|
const MENU_BUTTON_ICON = 'menu';
|
||||||
const iconNames = findIcons('./src', 'hassio');
|
|
||||||
|
function genHassioIcons() {
|
||||||
|
const iconNames = findIcons('./src', 'hassio').concat(MENU_BUTTON_ICON);
|
||||||
fs.writeFileSync('./hassio-icons.html', generateIconset('hassio', iconNames));
|
fs.writeFileSync('./hassio-icons.html', generateIconset('hassio', iconNames));
|
||||||
}
|
}
|
||||||
|
|
||||||
genHassIcons();
|
genHassioIcons();
|
||||||
|
@ -7,7 +7,6 @@ import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
|||||||
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||||
|
|
||||||
import '../../../src/components/ha-menu-button.js';
|
import '../../../src/components/ha-menu-button.js';
|
||||||
// For hassio-iconset: hassio:menu
|
|
||||||
import '../../../src/resources/ha-style.js';
|
import '../../../src/resources/ha-style.js';
|
||||||
import '../hassio-markdown-dialog.js';
|
import '../hassio-markdown-dialog.js';
|
||||||
import './hassio-addon-audio.js';
|
import './hassio-addon-audio.js';
|
||||||
|
@ -8,7 +8,6 @@ import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
|||||||
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||||
|
|
||||||
import '../../src/components/ha-menu-button.js';
|
import '../../src/components/ha-menu-button.js';
|
||||||
// For hassio-iconset: hassio:menu
|
|
||||||
import '../../src/resources/ha-style.js';
|
import '../../src/resources/ha-style.js';
|
||||||
import './addon-store/hassio-addon-store.js';
|
import './addon-store/hassio-addon-store.js';
|
||||||
import './dashboard/hassio-dashboard.js';
|
import './dashboard/hassio-dashboard.js';
|
||||||
|
@ -48,6 +48,7 @@ class HaMenuButton extends EventsMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getIcon(hassio) {
|
_getIcon(hassio) {
|
||||||
|
// hass:menu
|
||||||
return `${hassio ? 'hassio' : 'hass'}:menu`;
|
return `${hassio ? 'hassio' : 'hass'}:menu`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class HuiCameraPreviewCard extends PolymerElement {
|
|||||||
|
|
||||||
_hassChanged(hass) {
|
_hassChanged(hass) {
|
||||||
if (this.lastChild && this._entityId) {
|
if (this.lastChild && this._entityId) {
|
||||||
const element = this.childNodes[0];
|
const element = this.lastChild;
|
||||||
const stateObj = hass.states[this._entityId];
|
const stateObj = hass.states[this._entityId];
|
||||||
element.stateObj = stateObj;
|
element.stateObj = stateObj;
|
||||||
element.hass = hass;
|
element.hass = hass;
|
||||||
|
@ -63,7 +63,7 @@ class HuiHistoryGraphCard extends PolymerElement {
|
|||||||
|
|
||||||
_hassChanged(hass) {
|
_hassChanged(hass) {
|
||||||
if (this.lastChild && this._entityId) {
|
if (this.lastChild && this._entityId) {
|
||||||
const element = this.childNodes[0];
|
const element = this.lastChild;
|
||||||
const stateObj = hass.states[this._entityId];
|
const stateObj = hass.states[this._entityId];
|
||||||
element.stateObj = stateObj;
|
element.stateObj = stateObj;
|
||||||
element.hass = hass;
|
element.hass = hass;
|
||||||
|
@ -63,7 +63,7 @@ class HuiMediaControlCard extends PolymerElement {
|
|||||||
|
|
||||||
_hassChanged(hass) {
|
_hassChanged(hass) {
|
||||||
if (this.lastChild && this._entityId) {
|
if (this.lastChild && this._entityId) {
|
||||||
const element = this.childNodes[0];
|
const element = this.lastChild;
|
||||||
const stateObj = hass.states[this._entityId];
|
const stateObj = hass.states[this._entityId];
|
||||||
element.stateObj = stateObj;
|
element.stateObj = stateObj;
|
||||||
element.hass = hass;
|
element.hass = hass;
|
||||||
|
@ -63,7 +63,7 @@ class HuiPlantStatusCard extends PolymerElement {
|
|||||||
|
|
||||||
_hassChanged(hass) {
|
_hassChanged(hass) {
|
||||||
if (this.lastChild && this._entityId) {
|
if (this.lastChild && this._entityId) {
|
||||||
const element = this.childNodes[0];
|
const element = this.lastChild;
|
||||||
const stateObj = hass.states[this._entityId];
|
const stateObj = hass.states[this._entityId];
|
||||||
element.stateObj = stateObj;
|
element.stateObj = stateObj;
|
||||||
element.hass = hass;
|
element.hass = hass;
|
||||||
|
@ -63,7 +63,7 @@ class HuiWeatherForecastCard extends PolymerElement {
|
|||||||
|
|
||||||
_hassChanged(hass) {
|
_hassChanged(hass) {
|
||||||
if (this.lastChild && this._entityId) {
|
if (this.lastChild && this._entityId) {
|
||||||
const element = this.childNodes[0];
|
const element = this.lastChild;
|
||||||
const stateObj = hass.states[this._entityId];
|
const stateObj = hass.states[this._entityId];
|
||||||
element.stateObj = stateObj;
|
element.stateObj = stateObj;
|
||||||
element.hass = hass;
|
element.hass = hass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user