Fixes and cleanup for #1299 and #1296 (#1300)

* Fixes and cleanup

* Rename function to genHassioIcons

* Update
This commit is contained in:
c727 2018-06-19 14:36:43 +02:00 committed by GitHub
parent cd33e2568a
commit 21dcbb3b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 10 deletions

View File

@ -5,9 +5,11 @@ const {
generateIconset,
} = require('../../gulp/tasks/gen-icons.js');
function genHassIcons() {
const iconNames = findIcons('./src', 'hassio');
const MENU_BUTTON_ICON = 'menu';
function genHassioIcons() {
const iconNames = findIcons('./src', 'hassio').concat(MENU_BUTTON_ICON);
fs.writeFileSync('./hassio-icons.html', generateIconset('hassio', iconNames));
}
genHassIcons();
genHassioIcons();

View File

@ -7,7 +7,6 @@ import { html } from '@polymer/polymer/lib/utils/html-tag.js';
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
import '../../../src/components/ha-menu-button.js';
// For hassio-iconset: hassio:menu
import '../../../src/resources/ha-style.js';
import '../hassio-markdown-dialog.js';
import './hassio-addon-audio.js';

View File

@ -8,7 +8,6 @@ import { html } from '@polymer/polymer/lib/utils/html-tag.js';
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
import '../../src/components/ha-menu-button.js';
// For hassio-iconset: hassio:menu
import '../../src/resources/ha-style.js';
import './addon-store/hassio-addon-store.js';
import './dashboard/hassio-dashboard.js';

View File

@ -48,6 +48,7 @@ class HaMenuButton extends EventsMixin(PolymerElement) {
}
_getIcon(hassio) {
// hass:menu
return `${hassio ? 'hassio' : 'hass'}:menu`;
}
}

View File

@ -63,7 +63,7 @@ class HuiCameraPreviewCard extends PolymerElement {
_hassChanged(hass) {
if (this.lastChild && this._entityId) {
const element = this.childNodes[0];
const element = this.lastChild;
const stateObj = hass.states[this._entityId];
element.stateObj = stateObj;
element.hass = hass;

View File

@ -63,7 +63,7 @@ class HuiHistoryGraphCard extends PolymerElement {
_hassChanged(hass) {
if (this.lastChild && this._entityId) {
const element = this.childNodes[0];
const element = this.lastChild;
const stateObj = hass.states[this._entityId];
element.stateObj = stateObj;
element.hass = hass;

View File

@ -63,7 +63,7 @@ class HuiMediaControlCard extends PolymerElement {
_hassChanged(hass) {
if (this.lastChild && this._entityId) {
const element = this.childNodes[0];
const element = this.lastChild;
const stateObj = hass.states[this._entityId];
element.stateObj = stateObj;
element.hass = hass;

View File

@ -63,7 +63,7 @@ class HuiPlantStatusCard extends PolymerElement {
_hassChanged(hass) {
if (this.lastChild && this._entityId) {
const element = this.childNodes[0];
const element = this.lastChild;
const stateObj = hass.states[this._entityId];
element.stateObj = stateObj;
element.hass = hass;

View File

@ -63,7 +63,7 @@ class HuiWeatherForecastCard extends PolymerElement {
_hassChanged(hass) {
if (this.lastChild && this._entityId) {
const element = this.childNodes[0];
const element = this.lastChild;
const stateObj = hass.states[this._entityId];
element.stateObj = stateObj;
element.hass = hass;