Skip to content

Commit

Permalink
Update blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Jul 30, 2016
1 parent fb2ea42 commit b65c7be
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 49 deletions.
4 changes: 2 additions & 2 deletions source/_components/panel_iframe.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ comments: false
sharing: true
footer: true
logo: home-assistant.png
ha_category: Other
ha_category: Frontend
ha_release: 0.25
---

Expand All @@ -32,7 +32,7 @@ panel_iframe:
Configuration variables:
- **[panael_name]** (*Required*): Name of the panel.
- **[panel_name]** (*Required*): Name of the panel.
- **title** (*Required*): Friendly title for the panel. Will be used in the sidebar.
- **icon** (*Optional*): The API token of your bot.
- **url** (*Required*): The chat ID of your user.
Expand Down
2 changes: 1 addition & 1 deletion source/_cookbook/custom_panel_using_react.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ react_panel:
title: 'React'
```
This video shows the frontend in action.
This video shows the example in action.
<div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/2200UutdXlo" frameborder="0" allowfullscreen></iframe>
Expand Down
36 changes: 19 additions & 17 deletions source/_posts/2016-07-30-tbd.markdown
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
---
layout: post
title: "0.25: iFrame panels, Jupyther notebooks, DirecTV."
title: "0.25: Custom frontend panels, Jupyter notebooks, DirecTV."
description: "This new release of Home Assistant contains support for iFrame panels."
date: 2016-07-30 12:00:00 +0000
date_formatted: "July 30, 2016"
author: Fabian Affolter
author: Fabian Affolter & Paulus Schoutsen
author_twitter: fabaff
comments: true
categories: Release-Notes
---

We are proud to annonce the availability of Home Assistant 0.25. One highlight in this release are the three new media player platforms. This means that today Home Assistant inclused 26 media player integrations.
When Home Assistant started the focus has always been on making a great developer experience. Allowing anyone to add support for their favorite devices to Home Assistant easily. This focus has been a great success since we now have 339 components and platforms!

The brand-new [iFrame panels][panel] allows you to integrate third-party web frontends into Home Assistant. They will show up in the sidebar and can be used the same way as you open the frontend in your browser but all within one view. You would be also able to create your own frontend with [custom] panels.
Starting with this release, we are extending our extensability to the frontend. Starting this release, any component can [add it's own page to the frontend][custom-panels]. Examples of this today are the map, logbook and history. We are looking forward to all the crazy panels you'll come up with!

<div class='videoWrapper'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/2200UutdXlo" frameborder="0" allowfullscreen></iframe>
</div>
We have also seen an exciting trend of people starting to visualize their Internet of Things data using [Jupyter] Notebooks, which are a great way to create and share documents that contain code, visualizations, and explanatory text. In case you missed it, the [blog] post by [@kireyeu] shows an advanced usecase while our [Notebooks][jupyter-notebooks] in the [Home Assistant Notebooks repository][jupyter-repo] cover the basics.

The [Jupyter] Notebooks are a great way to create and share documents that contain code, visualizations, and explanatory text. It's easy to work with your stored information about your home. The [blog] post by [@kireyeu] shows an advanced usecase while our [Notebooks][jupyter-notebooks] in the [Home Assistant Notebooks repository][jupyter-repo] only covers the basics.
This release also includes a bunch of new integrations, among others three new media player platforms. This means that today Home Assistant cna talk to 26 different media players!

Starting with this release cycle we are now using [typing] as described in [PEP484]. This is another step to improve the code and make us ready for the future. The test coverage is still 99.9999999 %.
The brand-new [iFrame panel component][iframe_panel] allows you to add other websites as pages in the Home Assistant frontend. They will show up in the sidebar and can be used the same way as you open the frontend in your browser but all within one view.

I would like to do a shoutout to [@fabianhjr]. He has started adding [typing] data ([PEP484]) to the Home Assistant core. This will help us identify issues before they are released.

<img src='/images/supported_brands/russound.png' style='clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;' width='150' /><img src='/images/supported_brands/jupyter.png' style='clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;' width='150' /><img src='/images/supported_brands/directv.png' style='clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;' width='150' />

- Frontend: Support for [iFrame panels][panel] to adding other sites to sidebar ([@balloob])
- Frontend: Support for [iFrame panels][iframe_panel] to adding other sites to sidebar ([@balloob])
- Allow components to register [custom frontend panels][custom-panels] ([@balloob])
- Add example custom_component [react_panel][react-panel] showing custom panels ([@balloob])
- Light: [MagicLight/Flux WiFi Color LED Light][flux] support ([@Danielhiversen])
- Script: Delay support for [Scripts][script] ([@Teagan42])
- Media player: [Russound RNET][Russound] integration ([@laf])
- Remote: Option specifying custom timeout when calling Home Assistant API ([@n8henrie])
- Tests: Dependencies were removed from tests ([@balloob])
- Thermostat: Integration of [KNX] thermostats (@open-homeautomation])
- Thermostat: Integration of [KNX] thermostats ([@open-homeautomation])
- Thermostat: Support for HVAC mode of [Nest] devices ([@vladonemo])
- InfluxDB: Option to specify additional [tags] ([@open-homeautomation])
- Input slider: Support for float value ([@ngraziano])
Expand All @@ -46,7 +46,7 @@ Starting with this release cycle we are now using [typing] as described in [PEP4
- Remote: Support for getting the [Configuration] through the Python API ([@fabaff])
- Media player: Support for [DirecTV] ([@cbulock])
- Use browser timezone for frontend logbook and history dates ([@armills])
- Light: New support for [x10] lights ([@fotoetienne])
- Light: New support for [X10] lights ([@fotoetienne])
- Sensor: Support for observing [IMAP] accounts ([@danieljkemp])
- Media Player: Integration for [MPC-HC] (Media Player Classic - Home Cinema) mediaplayer ([@abcminiuser])
- Notify: `location` extension for [Telegram] and photo bug fixed ([@keatontaylor] and [@pvizeli])
Expand All @@ -63,7 +63,7 @@ Starting with this release cycle we are now using [typing] as described in [PEP4
- Google Voice SMS notification support was removed.

[@abcminiuser]: https://github.com/abcminiuser
[@americanwookie]: https://github.com/americanwookie
[@americanwookie]: https://github.com/americanwookie
[@armills]: https://github.com/armills
[@balloob]: https://github.com/balloob
[@cbulock]: https://github.com/cbulock
Expand All @@ -90,24 +90,26 @@ Starting with this release cycle we are now using [typing] as described in [PEP4
[@w1ll1am23]: https://github.com/w1ll1am23
[@zeroDenial]: https://github.com/zeroDenial

[panel]: /components/planel_iframe/
[custom-panels]: /developers/frontend_creating_custom_panels/
[iframe_panel]: /components/panel_iframe/
[custom]: /cookbook/custom_panel_using_react/
[flux]: /component/light.flux_led/
[script]: /components/script/
[Russound]: /component/media_player.russound_rnet/
[tags]: /component/influxdb/
[tags]: /component/influxdb/
[filter]: /topics/templating/
[jupyter-notebooks]: /cookbook/#jupyter-notebooks
[jupyter-repo]: https://github.com/home-assistant/home-assistant-notebooks
[Jupyter]: http://jupyter.org/
[blog]: /blog/2016/07/23/internet-of-things-data-exploration-with-jupyter-notebooks/
[DirecTV]: /component/media_player.directv/
[Configuration]: /developers/python_api/
[x10]: /components/light.x10/
[X10]: /components/light.x10/
[IMAP]: /component/sensor.imap/
[type]: https://docs.python.org/3/library/typing.html
[PEP484]: https://www.python.org/dev/peps/pep-0484/
[MPC-HC]: /components/media_player.mpchc/
[Telegram]: /components/notify.telegram/
[react-panel]: /cookbook/custom_panel_using_react/
[custom-panels]: /developers/frontend_creating_custom_panels/
[KNX]: /components/thermostat.knx/
[Nest]: /components/thermostat.nest/
45 changes: 16 additions & 29 deletions source/developers/frontend_creating_custom_panels.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ sharing: true
footer: true
---

Starting with 0.25 there is support for custom panels. This means that you can create a frontend in the way you want and hook it into Home Assistant.
Any component has the possibility to add a panel to the frontend. Panels will be rendered full screen and have real-time access to the Home Assistant object via JavaScript. Examples of this in the app are map, logbook and history.

Create a `__init__.py` file which is loading the panel in a sub-folder like `hello_panel` of your `.homeassistant/custom_components/` folder.
Adding a custom panel to your component is easy. For this example we're assuming your component is in `hello_panel.py`. Start by converting your panel to a folder. Create a folder called `hello_panel` and move `hello_panel.py` to `hello_panel/__init__.py`. In that same folder, create a file `panel.html`.

Your component should register the panel. The minimum required code for your component is:

```python
"""A minimal custom panel example."""
Expand All @@ -27,41 +29,22 @@ PANEL_PATH = os.path.join(os.path.dirname(__file__), 'panel.html')

def setup(hass, config):
"""Initialize a minimal custom panel."""
title = config.get(DOMAIN, {}).get('title')

config = None if title is None else {'title': title}

register_panel(hass, 'hello', PANEL_PATH, title='Hello World',
icon='mdi:appnet', config=config)
icon='mdi:appnet', config=config.get(DOMAIN, {}))
return True
```

The `panel.html` contains the needed building blocks to create the elements inside the view.

```html
```javascript
<dom-module id='ha-panel-hello'>
<template>
<style>
:host {
background: #f5f5f5;
display: block;
height: 100%;
overflow: auto;
}
.mount {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
color: #4d4d4d;
min-width: 230px;
max-width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
font-weight: 300;
p {
font-weight: bold;
}
</style>
<p>Hello {{who}}. Greetings from Home Assistant.</p>
<p>Hello {% raw %}{{who}}{% endraw %}. Greetings from Home Assistant.</p>
</template>
</dom-module>

Expand Down Expand Up @@ -90,9 +73,13 @@ Polymer({
},
who: {
type: String,
value: 'You'
computed: 'computeWho(panel)',
}
}
},

computeWho: function (panel) {
return panel && panel.config && panel.config.who ? panel.config.who : 'World';
},
});
</script>
```
Expand All @@ -101,7 +88,7 @@ Create an entry for the new panel in your `configuration.yaml` file:

```yaml
hello_panel:
title: 'Custom panel'
who: 'You'
```
For more examples, see the [Custom panel Examples](/cookbook#custom-panel-examples) on our examples page.
Binary file modified source/images/supported_brands/directv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed source/images/supported_brands/russound.gif
Binary file not shown.
Binary file added source/images/supported_brands/russound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b65c7be

Please sign in to comment.