diff --git a/atom.xml b/atom.xml index 8fb4168f15..07a10e66d9 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/announcements/atom.xml b/blog/categories/announcements/atom.xml index 80ca9d8061..dfbac60bfa 100644 --- a/blog/categories/announcements/atom.xml +++ b/blog/categories/announcements/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Announcements | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index 422e841f9d..20d5669fac 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index 7449926284..ecac5e67ca 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index 043246bda1..16508e65f3 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index f39e9dd9cb..bdd1927eac 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index a3166bbe9c..23ecb8b711 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index bb160f6aa7..aa31e79d32 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index ac744f9661..5e969459b0 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/media/atom.xml b/blog/categories/media/atom.xml index d540e749bc..ab01b366b9 100644 --- a/blog/categories/media/atom.xml +++ b/blog/categories/media/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Media | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/merchandise/atom.xml b/blog/categories/merchandise/atom.xml index 860493728c..35336ff11e 100644 --- a/blog/categories/merchandise/atom.xml +++ b/blog/categories/merchandise/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Merchandise | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/micropython/atom.xml b/blog/categories/micropython/atom.xml index 71c71208c7..c2333a7f4e 100644 --- a/blog/categories/micropython/atom.xml +++ b/blog/categories/micropython/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Micropython | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index a6de824e7e..d9ad2a62f0 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index 4f7d7a9b44..40b5f50908 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index 8a64a8ec02..91ed5606bf 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index a552253238..d19a36d445 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 51ec5cdcda..f728f1e011 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 27f9ab3af9..0deb05801c 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index 87166c9006..8a0ed3838b 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index 7a03d2291f..e96db793d2 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 424082db91..7cd1ab5245 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index d540e7765f..eeadae3455 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index b1189f27ab..a1effcdbc3 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index 6fd78db0ad..568a79c439 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2017-10-31T22:15:27+00:00 + 2017-11-01T05:34:01+00:00 https://home-assistant.io/ diff --git a/developers/frontend/index.html b/developers/frontend/index.html index 09bf15bc04..de70b06d72 100644 --- a/developers/frontend/index.html +++ b/developers/frontend/index.html @@ -79,60 +79,59 @@ Do not use development mode in production. Home Assistant uses aggressive caching to improve the mobile experience. This is disabled during development so that you do not have to restart the server in between changes.

Setting up the environment

-

Home Assistant will by default serve the compiled version of the frontend. As everything is compiled into the file frontend.html you do not want to work with the compiled version but with the separate files during development. To enable development mode for Home Assistant, update your configuration.yaml to have these lines:

-
http:
-  development: 1
+

+All commands below need to be run from inside the home-assistant-polymer repository. +

+

Home Assistant will by default serve the compiled version of the frontend from the hass_frontend Python package. For development you want to work with the unbundled source files which are in the home-assistant-polymer repository.

+

First step is to configure Home Assistant to use the development mode for the frontend. Do this by updating the frontend config in your configuration.yaml and set the path to the polymer repo:

+
frontend:
+  development_repo: ../home-assistant-polymer
 
-

Node.js is required to setup the frontend development environment. The preferred method of installing node.js is nvm. Install nvm using the instructions in the README, and install the correct node.js by running the following command from the home-assistant directory:

-
$ git submodule update --init
-$ nvm install $(<homeassistant/components/frontend/www_static/home-assistant-polymer/.nvmrc)
+

Next step is to git clone the home-assistant-polymer repository. You can place the repository anywhere on your system but to keep these instructions simple we’re cloning the home-assistant-polymer repository as a sibling to the Home Assistant repo.

+
$ git clone https://github.com/home-assistant/home-assistant-polymer.git
+$ cd home-assistant-polymer
+
+
+

After cloning, your folder structure should look like this:

+
/home-assistant
+/home-assistant-polymer
+
+
+

Node.js is required to build the frontend. The preferred method of installing node.js is with nvm. Install nvm using the instructions in the README, and install the correct node.js by running the following command:

+
$ nvm install
 

Yarn is used as the package manager for node modules. Install yarn using the instructions here.

-

Next, development dependencies need to be installed to bootstrap the frontend development environment by running from the home-assistant directory:

-
$ script/bootstrap_frontend
+

Next, development dependencies need to be installed to bootstrap the frontend development environment. First activate the right Node version and then download all the needed modules and do a first build:

+
$ nvm use
+$ script/bootstrap
 
-

This script will use yarn and bower to install all the necessary dependencies necessary for development in

-

home-assistant/homeassistant/components/frontend/www_static/home-assistant-polymer.

-

If you’re planning on issuing a PR back to the Home Assistant codebase you need to fork the polymer project and add your fork as a remote.

-
$ cd homeassistant/components/frontend/www_static/home-assistant-polymer
-$ git remote add <remote name> <github URL to your fork>
+

This script will use yarn and bower to install all the necessary dependencies necessary for development and do an initial build.

+

Creating pull requests

+

If you’re planning on issuing a PR back to the Home Assistant codebase you need to fork the polymer project and add your fork as a remote to the Home Assistant Polymer repo.

+
$ git remote add <remote name> <github URL to your fork>
 

When you’ve made your changes and are ready to push them change to the working directory for the polymer project and then push your changes

-
$ cd homeassistant/components/frontend/www_static/home-assistant-polymer
+
$ git add -A
+$ git commit -m "Added new feature X"
 $ git push -u <remote name> HEAD
 

Development

-

While you are developing, you need to have Rollup running to have changes you make to the JavaScript app-core made available.

-
$ cd homeassistant/components/frontend/www_static/home-assistant-polymer
-$ yarn run dev
+

While you are developing, you need to have gulp running to watch the source files for changes and build when necessary.

+
$ yarn run dev-watch
 

The source code for the frontend can be found in two different directories:

    -
  • UI: homeassistant/components/frontend/www_static/home-assistant-polymer/src/
  • -
  • Panels: homeassistant/components/frontend/www_static/home-assistant-polymer/panels/
  • +
  • UI: /home-assistant-polymer/src/
  • +
  • Panels: /home-assistant-polymer/panels/

Building the Polymer frontend

-

Building a new version of the frontend is as simple as running script/build_frontend. This fires off the following commands:

-
    -
  • home-assistant-polymer: Install NPM dependencies.
  • -
  • home-assistant-polymer: start frontend build. -
      -
    • Compile all used JavaScript.
    • -
    • Install Bower dependencies.
    • -
    • Vulcanize and minify the core and panel sources to build dir.
    • -
    -
  • -
  • Copy the webcomponents polyfill webcomponents-lite.min.js from home-assistant-polymer to components/frontend/www_static/webcomponents-lite.min.js.
  • -
  • Copy the final frontend build frontend.html and panel sources from home-assistant-polymer to components/frontend/www_static/frontend/.
  • -
  • Generate MD5 hashes of core and panel sources.
  • -
  • Create gzip versions of all the sources.
  • -
+

Building a new version of the frontend is as simple as running script/build_frontend.