diff --git a/.eslintrc b/.eslintrc
index e53662fda9..0ed0aa0651 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,6 +4,9 @@
"__DEV__": false,
"Polymer": true
},
+ "env": {
+ "browser": true
+ },
"rules": {
"new-cap": 0,
"prefer-template": 0,
diff --git a/.gitignore b/.gitignore
index 1cbd9d7a58..c9c5fd4d5d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
build/*
+build-temp/*
node_modules/*
bower_components/*
npm-debug.log
diff --git a/home-assistant-js b/home-assistant-js
index 8ad1b80dac..0209bcdd0b 160000
--- a/home-assistant-js
+++ b/home-assistant-js
@@ -1 +1 @@
-Subproject commit 8ad1b80dac98aeefba73fb1081f51b9fb1cb6952
+Subproject commit 0209bcdd0b7491d539f05887347d66a63e0da42c
diff --git a/package.json b/package.json
index 614c05d6d4..050b846f76 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
},
"scripts": {
"setup_js_dev": "git submodule init && git submodule update && cd home-assistant-js && npm install",
- "js_dev": "watch_ru_all",
+ "clean": "rm -rf build/* build-temp/*",
+ "js_dev": "npm run watch_ru_all",
"js_dev_demo": "BUILD_DEMO=1 npm run watch_ru_all",
"js_prod": "BUILD_DEV=0 npm run ru_all",
"js_demo": "BUILD_DEV=0 BUILD_DEMO=1 npm run ru_all",
@@ -36,9 +37,9 @@
},
"devDependencies": {
"bower": "^1.7.9",
- "eslint": "^3.0.1",
- "eslint-config-airbnb-base": "^4.0.0",
- "eslint-plugin-import": "^1.10.2",
+ "eslint": "^3.1.0",
+ "eslint-config-airbnb-base": "^4.0.2",
+ "eslint-plugin-import": "^1.10.3",
"html-minifier": "^3.0.1",
"rollup": "^0.34.1",
"rollup-plugin-babel": "^2.6.1",
diff --git a/src/components/events-list.html b/panels/dev-event/events-list.html
similarity index 93%
rename from src/components/events-list.html
rename to panels/dev-event/events-list.html
index b7b3378037..6d5fd19633 100644
--- a/src/components/events-list.html
+++ b/panels/dev-event/events-list.html
@@ -1,4 +1,4 @@
-
+
+
+
+
+ History
+
+
+
+
+
+
+
+
+
diff --git a/panels/iframe/ha-panel-iframe.html b/panels/iframe/ha-panel-iframe.html
new file mode 100644
index 0000000000..7ff7e4a7f4
--- /dev/null
+++ b/panels/iframe/ha-panel-iframe.html
@@ -0,0 +1,38 @@
+
+
+
+
+ [[panel.title]]
+
+
+
+
+
+
diff --git a/src/components/ha-logbook.html b/panels/logbook/ha-logbook.html
similarity index 76%
rename from src/components/ha-logbook.html
rename to panels/logbook/ha-logbook.html
index 4408fe155f..d494a923b2 100644
--- a/src/components/ha-logbook.html
+++ b/panels/logbook/ha-logbook.html
@@ -1,6 +1,8 @@
+
-
+
-
+
No logbook entries found.
@@ -33,9 +35,5 @@ Polymer({
value: [],
},
},
-
- noEntries: function (entries) {
- return !entries.length;
- },
});
diff --git a/panels/logbook/ha-panel-logbook.html b/panels/logbook/ha-panel-logbook.html
new file mode 100644
index 0000000000..f6a8239ea8
--- /dev/null
+++ b/panels/logbook/ha-panel-logbook.html
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+ Logbook
+
+
+
+
+
+
+
+
Loading logbook entries
+
+
+
+
+
+
+
+
diff --git a/src/components/logbook-entry.html b/panels/logbook/logbook-entry.html
similarity index 84%
rename from src/components/logbook-entry.html
rename to panels/logbook/logbook-entry.html
index 14c8212460..787db644d7 100644
--- a/src/components/logbook-entry.html
+++ b/panels/logbook/logbook-entry.html
@@ -1,8 +1,10 @@
+
@@ -54,3 +56,20 @@
+
+
diff --git a/src/components/entity/ha-entity-marker.html b/panels/map/ha-entity-marker.html
similarity index 99%
rename from src/components/entity/ha-entity-marker.html
rename to panels/map/ha-entity-marker.html
index 8a980ec7a8..97f4293d28 100644
--- a/src/components/entity/ha-entity-marker.html
+++ b/panels/map/ha-entity-marker.html
@@ -1,6 +1,8 @@
+
diff --git a/src/layouts/partial-map.html b/panels/map/ha-panel-map.html
similarity index 97%
rename from src/layouts/partial-map.html
rename to panels/map/ha-panel-map.html
index 3b67e740b3..07049ea437 100644
--- a/src/layouts/partial-map.html
+++ b/panels/map/ha-panel-map.html
@@ -1,14 +1,15 @@
+
-
+
-
+
-
-
-
- History
-
-
-
-
-
-
-
diff --git a/src/layouts/partial-history.js b/src/layouts/partial-history.js
deleted file mode 100644
index 5fc9e2cb6c..0000000000
--- a/src/layouts/partial-history.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import Polymer from '../polymer';
-
-import '../components/state-history-charts';
-
-export default new Polymer({
- is: 'partial-history',
-
- behaviors: [window.hassBehavior],
-
- properties: {
- hass: {
- type: Object,
- },
-
- narrow: {
- type: Boolean,
- },
-
- showMenu: {
- type: Boolean,
- value: false,
- },
-
- isDataLoaded: {
- type: Boolean,
- bindNuclear: hass => hass.entityHistoryGetters.hasDataForCurrentDate,
- observer: 'isDataLoadedChanged',
- },
-
- stateHistory: {
- type: Object,
- bindNuclear: hass => hass.entityHistoryGetters.entityHistoryForCurrentDate,
- },
-
- isLoadingData: {
- type: Boolean,
- bindNuclear: hass => hass.entityHistoryGetters.isLoadingEntityHistory,
- },
-
- selectedDate: {
- type: String,
- value: null,
- bindNuclear: hass => hass.entityHistoryGetters.currentDate,
- },
- },
-
- isDataLoadedChanged(newVal) {
- if (!newVal) {
- this.async(() => this.hass.entityHistoryActions.fetchSelectedDate(), 1);
- }
- },
-
- handleRefreshClick() {
- this.hass.entityHistoryActions.fetchSelectedDate();
- },
-
- datepickerFocus() {
- this.datePicker.adjustPosition();
- },
-
- attached() {
- this.datePicker = new window.Pikaday({
- field: this.$.datePicker.inputElement,
- onSelect: this.hass.entityHistoryActions.changeCurrentDate,
- });
- },
-
- detached() {
- this.datePicker.destroy();
- },
-
- computeContentClasses(narrow) {
- return `flex content ${narrow ? 'narrow' : 'wide'}`;
- },
-});
diff --git a/src/layouts/partial-logbook.html b/src/layouts/partial-logbook.html
deleted file mode 100644
index 828c2f0734..0000000000
--- a/src/layouts/partial-logbook.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Logbook
-
-
-
-
-
-
-
-
Loading logbook entries
-
-
-
-
-
-
diff --git a/src/layouts/partial-logbook.js b/src/layouts/partial-logbook.js
deleted file mode 100644
index cffc0ab497..0000000000
--- a/src/layouts/partial-logbook.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import Polymer from '../polymer';
-
-import '../components/logbook-entry';
-
-export default new Polymer({
- is: 'partial-logbook',
-
- behaviors: [window.hassBehavior],
-
- properties: {
- hass: {
- type: Object,
- },
-
- narrow: {
- type: Boolean,
- value: false,
- },
-
- showMenu: {
- type: Boolean,
- value: false,
- },
-
- selectedDate: {
- type: String,
- bindNuclear: hass => hass.logbookGetters.currentDate,
- },
-
- isLoading: {
- type: Boolean,
- bindNuclear: hass => hass.logbookGetters.isLoadingEntries,
- },
-
- isStale: {
- type: Boolean,
- bindNuclear: hass => hass.logbookGetters.isCurrentStale,
- observer: 'isStaleChanged',
- },
-
- entries: {
- type: Array,
- bindNuclear: hass => [
- hass.logbookGetters.currentEntries,
- (entries) => entries.reverse().toArray(),
- ],
- },
-
- datePicker: {
- type: Object,
- },
- },
-
- isStaleChanged(newVal) {
- if (newVal) {
- this.async(() => this.hass.logbookActions.fetchDate(this.selectedDate), 1);
- }
- },
-
- handleRefresh() {
- this.hass.logbookActions.fetchDate(this.selectedDate);
- },
-
- datepickerFocus() {
- this.datePicker.adjustPosition();
- },
-
- attached() {
- this.datePicker = new window.Pikaday({
- field: this.$.datePicker.inputElement,
- onSelect: this.hass.logbookActions.changeCurrentDate,
- });
- },
-
- detached() {
- this.datePicker.destroy();
- },
-});
diff --git a/src/layouts/partial-panel-resolver.html b/src/layouts/partial-panel-resolver.html
new file mode 100644
index 0000000000..a0bc993aaf
--- /dev/null
+++ b/src/layouts/partial-panel-resolver.html
@@ -0,0 +1,68 @@
+
diff --git a/src/resources/panel-imports.html b/src/resources/panel-imports.html
new file mode 100644
index 0000000000..3891df1a96
--- /dev/null
+++ b/src/resources/panel-imports.html
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/src/util/domain-icon.js b/src/util/domain-icon.js
index 8c904f6666..947bf15d81 100644
--- a/src/util/domain-icon.js
+++ b/src/util/domain-icon.js
@@ -1,6 +1,6 @@
import defaultIcon from './default-icon';
-export default function domainIcon(domain, state) {
+window.domainIcon = function (domain, state) {
switch (domain) {
case 'alarm_control_panel':
return state && state === 'disarmed' ? 'mdi:bell-outline' : 'mdi:bell';
@@ -98,4 +98,6 @@ export default function domainIcon(domain, state) {
}
return defaultIcon;
}
-}
+};
+
+export default window.domainIcon;