mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Upgrade to babel 6
This commit is contained in:
parent
e9ed569614
commit
f4d80f4977
12
.babelrc
12
.babelrc
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"stage": 1,
|
"presets": ["es2015"],
|
||||||
"highlightCode": true,
|
"plugins": ["transform-object-rest-spread", "transform-export-extensions",
|
||||||
"optional": ["es7.objectRestSpread", "es7.classProperties"],
|
"transform-class-properties", "babel-plugin-default-import-checker"],
|
||||||
"env": {
|
"highlightCode": true
|
||||||
"production": {
|
|
||||||
"optional": ["optimisation"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
19
package.json
19
package.json
@ -20,19 +20,24 @@
|
|||||||
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#692a36d63523a980d64088ccf52f63d44e9f1602",
|
"home-assistant-js": "git+https://github.com/balloob/home-assistant-js.git#b35fb90c94c1dfbb45c9691e9789f0b84b949d94",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"moment": "^2.10.6"
|
"moment": "^2.10.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^5.8.29",
|
"babel-core": "^6.3",
|
||||||
"babel-eslint": "^4.1.5",
|
"babel-eslint": "^5.0.0-beta6",
|
||||||
"babel-loader": "^5.3.2",
|
"babel-loader": "^6.2",
|
||||||
|
"babel-plugin-default-import-checker": "^1.0.8",
|
||||||
|
"babel-plugin-transform-class-properties": "^6.3.13",
|
||||||
|
"babel-plugin-transform-export-extensions": "^6.3.13",
|
||||||
|
"babel-plugin-transform-object-rest-spread": "^6.3.13",
|
||||||
|
"babel-preset-es2015": "^6.0.0",
|
||||||
"bower": "^1.6.5",
|
"bower": "^1.6.5",
|
||||||
"eslint": "^1.9",
|
"eslint": "^1.10.3",
|
||||||
"eslint-config-airbnb": "^1.0.0",
|
"eslint-config-airbnb": "^0.1.0",
|
||||||
"html-minifier": "^1.0.0",
|
"html-minifier": "^1.0.0",
|
||||||
"vulcanize": "^1.14.0",
|
"vulcanize": "^1.14.0",
|
||||||
"webpack": "^1.12.2"
|
"webpack": "^1.12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import { moreInfoActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
import canToggle from '../util/can-toggle';
|
import canToggle from '../util/can-toggle';
|
||||||
|
|
||||||
require('../components/ha-card');
|
require('../components/ha-card');
|
||||||
require('../components/entity/ha-entity-toggle');
|
require('../components/entity/ha-entity-toggle');
|
||||||
require('../state-summary/state-card-content');
|
require('../state-summary/state-card-content');
|
||||||
|
|
||||||
|
const { moreInfoActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-domain-card',
|
is: 'ha-domain-card',
|
||||||
|
|
||||||
@ -36,7 +38,7 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
showGroupToggle(groupEntity, states) {
|
showGroupToggle(groupEntity, states) {
|
||||||
if (!groupEntity || groupEntity.state !== 'on' && groupEntity.state !== 'off') {
|
if (!groupEntity || !states || groupEntity.state !== 'on' && groupEntity.state !== 'off') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { entityGetters } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
const { entityGetters } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'entity-list',
|
is: 'entity-list',
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import Polymer from '../../polymer';
|
import Polymer from '../../polymer';
|
||||||
import {
|
import hass from '../../util/home-assistant-js-instance';
|
||||||
|
|
||||||
|
require('../../components/ha-label-badge');
|
||||||
|
|
||||||
|
const {
|
||||||
reactor,
|
reactor,
|
||||||
entityGetters,
|
entityGetters,
|
||||||
moreInfoActions,
|
moreInfoActions,
|
||||||
} from '../../util/home-assistant-js-instance';
|
} = hass;
|
||||||
|
|
||||||
require('../../components/ha-label-badge');
|
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-entity-marker',
|
is: 'ha-entity-marker',
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { serviceActions } from '../../util/home-assistant-js-instance';
|
import hass from '../../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../../polymer';
|
import Polymer from '../../polymer';
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-entity-toggle',
|
is: 'ha-entity-toggle',
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import Polymer from '../../polymer';
|
import Polymer from '../../polymer';
|
||||||
import {
|
import hass from '../../util/home-assistant-js-instance';
|
||||||
moreInfoActions,
|
|
||||||
serviceActions,
|
|
||||||
} from '../../util/home-assistant-js-instance';
|
|
||||||
import domainIcon from '../../util/domain-icon';
|
import domainIcon from '../../util/domain-icon';
|
||||||
import canToggle from '../../util/can-toggle';
|
import canToggle from '../../util/can-toggle';
|
||||||
|
|
||||||
require('../../components/ha-label-badge');
|
require('../../components/ha-label-badge');
|
||||||
|
|
||||||
|
const {
|
||||||
|
moreInfoActions,
|
||||||
|
serviceActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-state-label-badge',
|
is: 'ha-state-label-badge',
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { eventGetters } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
const { eventGetters } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'events-list',
|
is: 'events-list',
|
||||||
|
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
configGetters,
|
|
||||||
navigationGetters,
|
|
||||||
authActions,
|
|
||||||
navigationActions,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('./stream-status');
|
require('./stream-status');
|
||||||
|
|
||||||
|
const {
|
||||||
|
configGetters,
|
||||||
|
navigationGetters,
|
||||||
|
authActions,
|
||||||
|
navigationActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-sidebar',
|
is: 'ha-sidebar',
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import { util } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
require('.//ha-demo-badge');
|
require('.//ha-demo-badge');
|
||||||
require('../cards/ha-badges-card');
|
require('../cards/ha-badges-card');
|
||||||
require('../cards/ha-domain-card');
|
require('../cards/ha-domain-card');
|
||||||
require('../cards/ha-introduction-card');
|
require('../cards/ha-introduction-card');
|
||||||
|
|
||||||
|
const { util } = hass;
|
||||||
const PRIORITY = {
|
const PRIORITY = {
|
||||||
configurator: -20,
|
configurator: -20,
|
||||||
group: -10,
|
group: -10,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { moreInfoActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
@ -6,6 +6,8 @@ require('./domain-icon');
|
|||||||
require('./display-time');
|
require('./display-time');
|
||||||
require('./relative-ha-datetime');
|
require('./relative-ha-datetime');
|
||||||
|
|
||||||
|
const { moreInfoActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'logbook-entry',
|
is: 'logbook-entry',
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { util } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
const UPDATE_INTERVAL = 60000; // 60 seconds
|
const UPDATE_INTERVAL = 60000; // 60 seconds
|
||||||
|
|
||||||
const { parseDateTime } = util;
|
const { util: { parseDateTime } } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'relative-ha-datetime',
|
is: 'relative-ha-datetime',
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { serviceGetters } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('./domain-icon');
|
require('./domain-icon');
|
||||||
|
|
||||||
|
const { serviceGetters } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'services-list',
|
is: 'services-list',
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { streamGetters, streamActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
const { streamGetters, streamActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'stream-status',
|
is: 'stream-status',
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
voiceActions,
|
|
||||||
voiceGetters,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
const {
|
||||||
|
voiceActions,
|
||||||
|
voiceGetters,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-voice-command-dialog',
|
is: 'ha-voice-command-dialog',
|
||||||
|
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
configGetters,
|
|
||||||
entityHistoryGetters,
|
|
||||||
entityHistoryActions,
|
|
||||||
moreInfoGetters,
|
|
||||||
moreInfoActions,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
@ -13,6 +7,14 @@ require('../state-summary/state-card-content');
|
|||||||
require('../components/state-history-charts');
|
require('../components/state-history-charts');
|
||||||
require('../more-infos/more-info-content');
|
require('../more-infos/more-info-content');
|
||||||
|
|
||||||
|
const {
|
||||||
|
configGetters,
|
||||||
|
entityHistoryGetters,
|
||||||
|
entityHistoryActions,
|
||||||
|
moreInfoGetters,
|
||||||
|
moreInfoActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
// if you don't want the history component to show add the domain to this array
|
// if you don't want the history component to show add the domain to this array
|
||||||
const DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'scene'];
|
const DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'scene'];
|
||||||
|
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
import Polymer from './polymer';
|
import Polymer from './polymer';
|
||||||
|
|
||||||
import {
|
import hass from './util/home-assistant-js-instance';
|
||||||
localStoragePreferences,
|
|
||||||
navigationActions,
|
|
||||||
reactor,
|
|
||||||
startLocalStoragePreferencesSync,
|
|
||||||
syncGetters,
|
|
||||||
} from './util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import nuclearObserver from './util/bound-nuclear-behavior';
|
import nuclearObserver from './util/bound-nuclear-behavior';
|
||||||
import validateAuth from './util/validate-auth';
|
import validateAuth from './util/validate-auth';
|
||||||
@ -14,6 +8,14 @@ import validateAuth from './util/validate-auth';
|
|||||||
require('./layouts/login-form');
|
require('./layouts/login-form');
|
||||||
require('./layouts/home-assistant-main');
|
require('./layouts/home-assistant-main');
|
||||||
|
|
||||||
|
const {
|
||||||
|
localStoragePreferences,
|
||||||
|
navigationActions,
|
||||||
|
reactor,
|
||||||
|
startLocalStoragePreferencesSync,
|
||||||
|
syncGetters,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'home-assistant',
|
is: 'home-assistant',
|
||||||
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
navigationActions,
|
|
||||||
navigationGetters,
|
|
||||||
startUrlSync,
|
|
||||||
stopUrlSync,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
@ -21,6 +16,13 @@ require('../managers/notification-manager');
|
|||||||
require('../dialogs/more-info-dialog');
|
require('../dialogs/more-info-dialog');
|
||||||
require('../dialogs/ha-voice-command-dialog');
|
require('../dialogs/ha-voice-command-dialog');
|
||||||
|
|
||||||
|
const {
|
||||||
|
navigationActions,
|
||||||
|
navigationGetters,
|
||||||
|
startUrlSync,
|
||||||
|
stopUrlSync,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'home-assistant-main',
|
is: 'home-assistant-main',
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
import { authGetters } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
import validateAuth from '../util/validate-auth';
|
import validateAuth from '../util/validate-auth';
|
||||||
|
|
||||||
|
const { authGetters } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'login-form',
|
is: 'login-form',
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
reactor,
|
|
||||||
serviceActions,
|
|
||||||
serviceGetters,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
require('./partial-base');
|
require('./partial-base');
|
||||||
require('../components/services-list');
|
require('../components/services-list');
|
||||||
|
|
||||||
|
const {
|
||||||
|
reactor,
|
||||||
|
serviceActions,
|
||||||
|
serviceGetters,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-dev-call-service',
|
is: 'partial-dev-call-service',
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { eventActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
require('./partial-base');
|
require('./partial-base');
|
||||||
require('../components/events-list');
|
require('../components/events-list');
|
||||||
|
|
||||||
|
const { eventActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-dev-fire-event',
|
is: 'partial-dev-fire-event',
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
configGetters,
|
|
||||||
errorLogActions,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('./partial-base');
|
require('./partial-base');
|
||||||
|
|
||||||
|
const {
|
||||||
|
configGetters,
|
||||||
|
errorLogActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-dev-info',
|
is: 'partial-dev-info',
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { reactor, entityGetters, entityActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
require('./partial-base');
|
require('./partial-base');
|
||||||
require('../components/entity-list');
|
require('../components/entity-list');
|
||||||
|
|
||||||
|
const { reactor, entityGetters, entityActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-dev-set-state',
|
is: 'partial-dev-set-state',
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
entityHistoryGetters,
|
|
||||||
entityHistoryActions,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
@ -9,6 +6,11 @@ import nuclearObserver from '../util/bound-nuclear-behavior';
|
|||||||
require('./partial-base');
|
require('./partial-base');
|
||||||
require('../components/state-history-charts');
|
require('../components/state-history-charts');
|
||||||
|
|
||||||
|
const {
|
||||||
|
entityHistoryGetters,
|
||||||
|
entityHistoryActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-history',
|
is: 'partial-history',
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { logbookGetters, logbookActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
@ -7,6 +7,8 @@ require('./partial-base');
|
|||||||
require('../components/ha-logbook');
|
require('../components/ha-logbook');
|
||||||
require('../components/loading-box');
|
require('../components/loading-box');
|
||||||
|
|
||||||
|
const { logbookGetters, logbookActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-logbook',
|
is: 'partial-logbook',
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
configGetters,
|
|
||||||
entityGetters,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('../components/entity/ha-entity-marker');
|
require('../components/entity/ha-entity-marker');
|
||||||
|
|
||||||
|
const {
|
||||||
|
configGetters,
|
||||||
|
entityGetters,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
window.L.Icon.Default.imagePath = '/static/images/leaflet';
|
window.L.Icon.Default.imagePath = '/static/images/leaflet';
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
|
import Polymer from '../polymer';
|
||||||
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
require('./partial-base');
|
||||||
|
require('../components/ha-zone-cards');
|
||||||
|
|
||||||
|
const {
|
||||||
configGetters,
|
configGetters,
|
||||||
entityGetters,
|
entityGetters,
|
||||||
voiceGetters,
|
voiceGetters,
|
||||||
@ -6,13 +14,7 @@ import {
|
|||||||
syncGetters,
|
syncGetters,
|
||||||
syncActions,
|
syncActions,
|
||||||
voiceActions,
|
voiceActions,
|
||||||
} from '../util/home-assistant-js-instance';
|
} = hass;
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
|
||||||
|
|
||||||
require('./partial-base');
|
|
||||||
require('../components/ha-zone-cards');
|
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'partial-zone',
|
is: 'partial-zone',
|
||||||
@ -67,6 +69,7 @@ export default new Polymer({
|
|||||||
|
|
||||||
columns: {
|
columns: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
value: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { notificationGetters } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
|
const { notificationGetters } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'notification-manager',
|
is: 'notification-manager',
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'more-info-alarm_control_panel',
|
is: 'more-info-alarm_control_panel',
|
||||||
handleDisarmTap() {
|
handleDisarmTap() {
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
streamGetters,
|
|
||||||
syncActions,
|
|
||||||
serviceActions,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('../components/loading-box');
|
require('../components/loading-box');
|
||||||
|
|
||||||
|
const {
|
||||||
|
streamGetters,
|
||||||
|
syncActions,
|
||||||
|
serviceActions,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'more-info-configurator',
|
is: 'more-info-configurator',
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
import {
|
import hass from '../util/home-assistant-js-instance';
|
||||||
entityGetters,
|
|
||||||
moreInfoGetters,
|
|
||||||
} from '../util/home-assistant-js-instance';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import nuclearObserver from '../util/bound-nuclear-behavior';
|
import nuclearObserver from '../util/bound-nuclear-behavior';
|
||||||
|
|
||||||
require('../state-summary/state-card-content');
|
require('../state-summary/state-card-content');
|
||||||
|
|
||||||
|
const {
|
||||||
|
entityGetters,
|
||||||
|
moreInfoGetters,
|
||||||
|
} = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'more-info-group',
|
is: 'more-info-group',
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import attributeClassNames from '../util/attribute-class-names';
|
import attributeClassNames from '../util/attribute-class-names';
|
||||||
|
|
||||||
require('../components/ha-color-picker');
|
require('../components/ha-color-picker');
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
const ATTRIBUTE_CLASSES = ['brightness', 'rgb_color', 'color_temp'];
|
const ATTRIBUTE_CLASSES = ['brightness', 'rgb_color', 'color_temp'];
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import attributeClassNames from '../util/attribute-class-names';
|
import attributeClassNames from '../util/attribute-class-names';
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
const ATTRIBUTE_CLASSES = ['volume_level'];
|
const ATTRIBUTE_CLASSES = ['volume_level'];
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import { util } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import formatTime from '../util/format-time';
|
import formatTime from '../util/format-time';
|
||||||
|
|
||||||
const { parseDateTime } = util;
|
const { util: { parseDateTime } } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'more-info-sun',
|
is: 'more-info-sun',
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import attributeClassNames from '../util/attribute-class-names';
|
import attributeClassNames from '../util/attribute-class-names';
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
const ATTRIBUTE_CLASSES = ['away_mode'];
|
const ATTRIBUTE_CLASSES = ['away_mode'];
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
require('../components/state-info');
|
require('../components/state-info');
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'state-card-rollershutter',
|
is: 'state-card-rollershutter',
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
require('../components/state-info.js');
|
require('../components/state-info.js');
|
||||||
|
|
||||||
|
const { serviceActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'state-card-scene',
|
is: 'state-card-scene',
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import { moreInfoActions } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
require('./state-card-content');
|
require('./state-card-content');
|
||||||
|
|
||||||
|
const { moreInfoActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'state-card',
|
is: 'state-card',
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { reactor } from '../util/home-assistant-js-instance';
|
import hass from './home-assistant-js-instance';
|
||||||
|
|
||||||
import nuclearObserver from './nuclear-behavior';
|
import nuclearObserver from './nuclear-behavior';
|
||||||
|
|
||||||
export default nuclearObserver(reactor);
|
export default nuclearObserver(hass.reactor);
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import {
|
import hass from './home-assistant-js-instance';
|
||||||
|
|
||||||
|
const {
|
||||||
reactor,
|
reactor,
|
||||||
serviceGetters,
|
serviceGetters,
|
||||||
} from './home-assistant-js-instance';
|
} = hass;
|
||||||
|
|
||||||
// Return boolean if entity can be toggled.
|
// Return boolean if entity can be toggled.
|
||||||
export default function canToggle(entityId) {
|
export default function canToggle(entityId) {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import defaultIcon from './default-icon';
|
import defaultIcon from './default-icon';
|
||||||
import domainIcon from './domain-icon.js';
|
import domainIcon from './domain-icon.js';
|
||||||
import {
|
import hass from './home-assistant-js-instance';
|
||||||
util,
|
|
||||||
} from './home-assistant-js-instance';
|
|
||||||
|
|
||||||
|
const { util: { temperatureUnits } } = hass;
|
||||||
|
|
||||||
export default function stateIcon(state) {
|
export default function stateIcon(state) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
@ -15,8 +14,8 @@ export default function stateIcon(state) {
|
|||||||
const unit = state.attributes.unit_of_measurement;
|
const unit = state.attributes.unit_of_measurement;
|
||||||
|
|
||||||
if (unit && state.domain === 'sensor') {
|
if (unit && state.domain === 'sensor') {
|
||||||
if (unit === util.temperatureUnits.UNIT_TEMP_C ||
|
if (unit === temperatureUnits.UNIT_TEMP_C ||
|
||||||
unit === util.temperatureUnits.UNIT_TEMP_F) {
|
unit === temperatureUnits.UNIT_TEMP_F) {
|
||||||
return 'mdi:thermometer';
|
return 'mdi:thermometer';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { authActions, localStoragePreferences } from '../util/home-assistant-js-instance';
|
import hass from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
|
const { authActions, localStoragePreferences } = hass;
|
||||||
|
|
||||||
export default function(authToken, rememberAuth) {
|
export default function(authToken, rememberAuth) {
|
||||||
authActions.validate(authToken, {
|
authActions.validate(authToken, {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
var path = require('path');
|
||||||
var webpack = require("webpack");
|
var webpack = require("webpack");
|
||||||
|
|
||||||
var definePlugin = new webpack.DefinePlugin({
|
var definePlugin = new webpack.DefinePlugin({
|
||||||
@ -19,7 +20,10 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
test: /.js$/,
|
test: /.js$/,
|
||||||
exclude: /node_modules\/(^home-assistant-js)/,
|
include: [
|
||||||
|
path.resolve(__dirname, 'src'),
|
||||||
|
path.resolve(__dirname, 'node_modules/home-assistant-js/src'),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user