Skip to content

Commit

Permalink
Merge pull request #2077 from home-assistant/dev
Browse files Browse the repository at this point in the history
20181121.0
balloob authored Nov 21, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2ccfccc + cbb703e commit 463c7ea
Showing 438 changed files with 15,847 additions and 10,437 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@ bin
dist

# vscode
.vscode
.vscode/*
!.vscode/extensions.json

# Secrets
.lokalise_token
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"eg2.tslint",
"esbenp.prettier-vscode"
]
}
4 changes: 2 additions & 2 deletions gallery/src/components/demo-card.js
Original file line number Diff line number Diff line change
@@ -38,9 +38,9 @@ class DemoCard extends PolymerElement {
}
</style>
<h2>[[config.heading]]</h2>
<div class='root'>
<div class="root">
<div id="card"></div>
<template is='dom-if' if='[[showConfig]]'>
<template is="dom-if" if="[[showConfig]]">
<pre>[[_trim(config.config)]]</pre>
</template>
</div>
18 changes: 9 additions & 9 deletions gallery/src/components/demo-cards.js
Original file line number Diff line number Diff line change
@@ -25,18 +25,18 @@ class DemoCards extends PolymerElement {
}
</style>
<app-toolbar>
<div class='filters'>
<paper-toggle-button
checked='{{_showConfig}}'
>Show config</paper-toggle-button>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show config</paper-toggle-button
>
</div>
</app-toolbar>
<div class='cards'>
<template is='dom-repeat' items='[[configs]]'>
<div class="cards">
<template is="dom-repeat" items="[[configs]]">
<demo-card
config='[[item]]'
show-config='[[_showConfig]]'
hass='[[hass]]'
config="[[item]]"
show-config="[[_showConfig]]"
hass="[[hass]]"
></demo-card>
</template>
</div>
86 changes: 43 additions & 43 deletions gallery/src/components/demo-more-info.js
Original file line number Diff line number Diff line change
@@ -8,56 +8,56 @@ import "../../../src/components/ha-card";
class DemoMoreInfo extends PolymerElement {
static get template() {
return html`
<style>
:host {
display: flex;
align-items: start;
}
<style>
:host {
display: flex;
align-items: start;
}
ha-card {
width: 333px;
}
ha-card {
width: 333px;
}
state-card-content {
display: block;
padding: 16px;
}
state-card-content {
display: block;
padding: 16px;
}
more-info-content {
padding: 0 16px;
}
more-info-content {
padding: 0 16px;
}
pre {
width: 400px;
margin: 16px;
overflow: auto;
}
pre {
width: 400px;
margin: 16px;
overflow: auto;
}
@media only screen and (max-width: 800px) {
:host {
flex-direction: column;
}
pre {
margin-left: 0;
}
@media only screen and (max-width: 800px) {
:host {
flex-direction: column;
}
pre {
margin-left: 0;
}
</style>
<ha-card>
<state-card-content
state-obj="[[_stateObj]]"
hass="[[hass]]"
in-dialog
></state-card-content>
}
</style>
<ha-card>
<state-card-content
state-obj="[[_stateObj]]"
hass="[[hass]]"
in-dialog
></state-card-content>
<more-info-content
hass='[[hass]]'
state-obj='[[_stateObj]]'
></more-info-content>
</ha-card>
<template is='dom-if' if='[[showConfig]]'>
<pre>[[_jsonEntity(_stateObj)]]</pre>
</template>
`;
<more-info-content
hass="[[hass]]"
state-obj="[[_stateObj]]"
></more-info-content>
</ha-card>
<template is="dom-if" if="[[showConfig]]">
<pre>[[_jsonEntity(_stateObj)]]</pre>
</template>
`;
}

static get properties() {
18 changes: 9 additions & 9 deletions gallery/src/components/demo-more-infos.js
Original file line number Diff line number Diff line change
@@ -25,18 +25,18 @@ class DemoMoreInfos extends PolymerElement {
}
</style>
<app-toolbar>
<div class='filters'>
<paper-toggle-button
checked='{{_showConfig}}'
>Show entity</paper-toggle-button>
<div class="filters">
<paper-toggle-button checked="{{_showConfig}}"
>Show entity</paper-toggle-button
>
</div>
</app-toolbar>
<div class='cards'>
<template is='dom-repeat' items='[[entities]]'>
<div class="cards">
<template is="dom-repeat" items="[[entities]]">
<demo-more-info
entity-id='[[item]]'
show-config='[[_showConfig]]'
hass='[[hass]]'
entity-id="[[item]]"
show-config="[[_showConfig]]"
hass="[[hass]]"
></demo-more-info>
</template>
</div>
6 changes: 6 additions & 0 deletions gallery/src/data/provide_hass.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,12 @@ export default (elements, { initialStates = {} } = {}) => {
resources: demoResources,
states: initialStates,
themes: {},
connection: {
subscribeEvents: async (callback, event) => {
console.log("subscribeEvents", event);
return () => console.log("unsubscribeEvents", event);
},
},

// Mock properties
mockEntities: entities,
6 changes: 5 additions & 1 deletion gallery/src/demos/demo-hui-alarm-panel-card.js
Original file line number Diff line number Diff line change
@@ -51,7 +51,11 @@ const CONFIGS = [
class DemoAlarmPanelEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id='demos' hass='[[hass]]' configs="[[_configs]]"></demo-cards>
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}

4 changes: 2 additions & 2 deletions gallery/src/demos/demo-hui-conditional-card.js
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@ class DemoConditional extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
hass='[[hass]]'
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-entities-card.js
Original file line number Diff line number Diff line change
@@ -175,10 +175,7 @@ const CONFIGS = [
class DemoEntities extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

6 changes: 5 additions & 1 deletion gallery/src/demos/demo-hui-entity-button-card.js
Original file line number Diff line number Diff line change
@@ -71,7 +71,11 @@ const CONFIGS = [
class DemoEntityButtonEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id='demos' hass='[[hass]]' configs="[[_configs]]"></demo-cards>
<demo-cards
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
}

5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-entity-filter-card.js
Original file line number Diff line number Diff line change
@@ -92,10 +92,7 @@ const CONFIGS = [
class DemoFilter extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-glance-card.js
Original file line number Diff line number Diff line change
@@ -217,10 +217,7 @@ const CONFIGS = [
class DemoPicEntity extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

2 changes: 1 addition & 1 deletion gallery/src/demos/demo-hui-light-card.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ const CONFIGS = [
class DemoLightEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id='demos' configs="[[_configs]]"></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

4 changes: 2 additions & 2 deletions gallery/src/demos/demo-hui-media-player-rows.js
Original file line number Diff line number Diff line change
@@ -78,8 +78,8 @@ class DemoHuiMediaPlayerRows extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
hass='[[hass]]'
id="demos"
hass="[[hass]]"
configs="[[_configs]]"
></demo-cards>
`;
5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-picture-elements-card.js
Original file line number Diff line number Diff line change
@@ -80,10 +80,7 @@ const CONFIGS = [
class DemoPicElements extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

52 changes: 52 additions & 0 deletions gallery/src/demos/demo-hui-shopping-list-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";

import provideHass from "../data/provide_hass";
import "../components/demo-cards";

const CONFIGS = [
{
heading: "List example",
config: `
- type: shopping-list
`,
},
{
heading: "List with title example",
config: `
- type: shopping-list
title: Shopping List
`,
},
];

class DemoShoppingListEntity extends PolymerElement {
static get template() {
return html`
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

static get properties() {
return {
_configs: {
type: Object,
value: CONFIGS,
},
};
}

ready() {
super.ready();
const hass = provideHass(this.$.demos);

hass.mockAPI("shopping_list", () => [
{ name: "list", id: 1, complete: false },
{ name: "all", id: 2, complete: false },
{ name: "the", id: 3, complete: false },
{ name: "things", id: 4, complete: true },
]);
}
}

customElements.define("demo-hui-shopping-list-card", DemoShoppingListEntity);
5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-stack-card.js
Original file line number Diff line number Diff line change
@@ -91,10 +91,7 @@ const CONFIGS = [
class DemoStack extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

5 changes: 1 addition & 4 deletions gallery/src/demos/demo-hui-thermostat-card.js
Original file line number Diff line number Diff line change
@@ -62,10 +62,7 @@ const CONFIGS = [
class DemoThermostatEntity extends PolymerElement {
static get template() {
return html`
<demo-cards
id='demos'
configs="[[_configs]]"
></demo-cards>
<demo-cards id="demos" configs="[[_configs]]"></demo-cards>
`;
}

4 changes: 2 additions & 2 deletions gallery/src/demos/demo-more-info-light.js
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ class DemoMoreInfoLight extends PolymerElement {
static get template() {
return html`
<demo-more-infos
hass='[[hass]]'
entities='[[_entities]]'
hass="[[hass]]"
entities="[[_entities]]"
></demo-more-infos>
`;
}
1 change: 1 addition & 0 deletions gulp/tasks/gen-icons.js
Original file line number Diff line number Diff line change
@@ -111,4 +111,5 @@ gulp.task("gen-icons", ["gen-icons-hass", "gen-icons-mdi"], () => {});
module.exports = {
findIcons,
generateIconset,
genMDIIcons,
};
Loading

0 comments on commit 463c7ea

Please sign in to comment.