Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f054cdc
Use overrideIcon via data binding (#2078)
balloob Nov 21, 2018
a825613
Dont change config on init (#2044)
bramkragten Nov 22, 2018
3497cb8
Convert toggle functions to TypeScript (#2082)
iantrich Nov 22, 2018
6885abd
Convert shopping-list add item call to websockets (#2080)
iantrich Nov 23, 2018
785ed6f
add "for" input field to numeric_state in trigger editor (#2081)
sholzmayer Nov 23, 2018
d41a4cf
Generate Lovelace config on the fly (#2091)
balloob Nov 23, 2018
a7ab652
Add support for timestamp device class (#2087)
balloob Nov 23, 2018
412b759
Handle non existing states (#2098)
balloob Nov 23, 2018
101a364
Type LovelaceConfig -> LovelaceCardConfig (#2103)
bramkragten Nov 24, 2018
b939ae6
Fix wrong import (#2106)
balloob Nov 25, 2018
69df617
Add dialog to save config (#2100)
bramkragten Nov 25, 2018
8ad5280
Document types in fireEvent (#2108)
balloob Nov 25, 2018
07b65f3
Add Cloud Webhook management (#2102)
balloob Nov 26, 2018
5ab4195
Convert authorize page to lit (#2115)
balloob Nov 26, 2018
278ea18
Update translations
balloob Nov 26, 2018
bb8ec4b
Bumped version to 20181126.0
balloob Nov 26, 2018
21be35b
Conert shopping-list update to WebSockets (#2114)
iantrich Nov 26, 2018
3752530
Update UI in the config Elements (#2117)
zsarnett Nov 26, 2018
1cc6e09
Add html to LitElement.prototype (#2120)
cdce8p Nov 26, 2018
97f5d8e
Move lovelace data to /src/data/lovelace.ts (#2119)
bramkragten Nov 27, 2018
4487c3d
Removes Height, Light Width and Line Color from Sensor (#2122)
zsarnett Nov 27, 2018
ffc7f97
Update Aspect Ratio on Map card (#2126)
zsarnett Nov 27, 2018
8757dbb
Plant add name (#2130)
zsarnett Nov 27, 2018
f04f58a
Change Title to Name (#2129)
zsarnett Nov 27, 2018
d2741af
Add name to config (#2128)
zsarnett Nov 27, 2018
bf69c8c
Title to Name (#2127)
zsarnett Nov 27, 2018
b37ea48
Add name variable - Weather Card (#2131)
zsarnett Nov 27, 2018
230ec51
Fixes: #2084 : Fix for extra padding (#2133)
zsarnett Nov 27, 2018
49be2ad
Unit PAtch (#2134)
zsarnett Nov 28, 2018
afe9056
Combine edit and complete shopping-list calls (#2135)
iantrich Nov 28, 2018
7a0b206
Add delete card func (#2116)
bramkragten Nov 28, 2018
c02b7a3
Resolve warning (#2142)
iantrich Nov 29, 2018
913cd2b
Automatically detect plants (#2146)
balloob Nov 29, 2018
8ecfd97
Convert hui-entities-toggle to TypeScript/LitElement (#2144)
iantrich Nov 29, 2018
a249289
Display alert entity row as a toggle (#2138)
pprazzi Nov 29, 2018
e4cac86
Convert shopping-list clear to WebSockets (#2141)
iantrich Nov 29, 2018
5e43d9b
Convert hui-media-player-entity-row to TypeScript/LitElement (#2136)
iantrich Nov 29, 2018
90cea56
Check if config is compatible with UI editor (#2137)
bramkragten Nov 29, 2018
6b730b7
Allow for state_image and camera_image in picture-elements card (#2143)
iantrich Nov 29, 2018
023d8ad
Upgrade deps (#2156)
balloob Nov 30, 2018
8e9ff46
Extract media-player constants to src/data (#2149)
iantrich Nov 30, 2018
22eb6c6
Remove special char
balloob Nov 30, 2018
882c503
Extract Supported features into own funciton (#2151)
iantrich Nov 30, 2018
0e6f6dd
Add own types + add config validation to glances (#2150)
bramkragten Nov 30, 2018
8ae03dd
Convert Sensor Card to Typescript (#2140)
zsarnett Dec 1, 2018
f3b8d66
Update demo-hui-glance-card.js (#2157)
Aephir Dec 1, 2018
f7e3f4a
Hass.io: Show ANSI color codes in logs (#2155)
OttoWinter Dec 2, 2018
d015fe5
Remove .ts extensions (#2169)
iantrich Dec 3, 2018
57b5db4
Move computeRTL to a separate file and add RTL support in state-info …
rhayun Dec 3, 2018
f461ad6
Add card functionality (#2160)
bramkragten Dec 3, 2018
5dc0512
Convert process-config-entities to TypeScript (#2113)
iantrich Dec 4, 2018
5fec881
Convert hui-picture-entity-card to TypeScript/LitElement (#2168)
iantrich Dec 4, 2018
f1a6122
Convert hui-unused-entities to TypeScript/LitElement (#2173)
iantrich Dec 4, 2018
77711ea
Stop MouseEvent from reach parent element (#2174)
iantrich Dec 4, 2018
f680832
Add edit/add/delete view (#2172)
bramkragten Dec 4, 2018
1d7f574
Fix process entity (#2177)
bramkragten Dec 4, 2018
8274284
Theme Addition (#2178)
zsarnett Dec 4, 2018
e2e002b
Fixes Color not being overwritten by themes for cards (#2179)
zsarnett Dec 5, 2018
16cc3ad
Add badges to view editor (#2176)
bramkragten Dec 5, 2018
0f895fd
Make Lovelace the default! (#2181)
bramkragten Dec 5, 2018
de3a467
Update Hold/Tap Actions to Objects (#2182)
zsarnett Dec 5, 2018
bfef3a9
Catch errors in preview and fix entity picker (#2183)
bramkragten Dec 5, 2018
3f113da
Fix: View should have cards (#2184)
bramkragten Dec 5, 2018
7e58440
Add gallery demo for Long Press directive (#2189)
balloob Dec 5, 2018
5947bd6
Align `picture-glance` card tap/hold actions (#2187)
iantrich Dec 5, 2018
fb180c7
Align `picture` card tap/hold actions (#2186)
iantrich Dec 5, 2018
9711068
Handle mouse events on touchscreens. Fix #2085 (#2170)
thomasloven Dec 5, 2018
2d0f14d
Update translations
balloob Dec 5, 2018
0cd4980
Bumped version to 20181205.0
balloob Dec 5, 2018
fdbb06d
Merge remote-tracking branch 'origin/master' into dev
balloob Dec 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DemoAlarmPanelEntity extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DemoConditional extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class DemoEntities extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DemoEntityButtonEntity extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class DemoFilter extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ const CONFIGS = [
`,
},
{
heading: "Custom column width",
heading: "Custom number of columns",
config: `
- type: glance
column_width: calc(100% / 7)
columns: 7
entities:
- device_tracker.demo_paulus
- media_player.living_room
Expand Down Expand Up @@ -230,7 +230,7 @@ class DemoPicEntity extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DemoLightEntity extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class DemoMap extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DemoHuiMediaPlayerRows extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class DemoPicElements extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DemoShoppingListEntity extends PolymerElement {
};
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DemoStack extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DemoThermostatEntity extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this.$.demos);
hass.addEntities(ENTITIES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ import getEntity from "../data/entity";
import provideHass from "../data/provide_hass";

import "../components/demo-more-infos";

/* eslint-disable no-unused-vars */

const SUPPORT_BRIGHTNESS = 1;
const SUPPORT_COLOR_TEMP = 2;
const SUPPORT_EFFECT = 4;
const SUPPORT_FLASH = 8;
const SUPPORT_COLOR = 16;
const SUPPORT_TRANSITION = 32;
const SUPPORT_WHITE_VALUE = 128;
import { SUPPORT_BRIGHTNESS } from "../../../src/data/light";

const ENTITIES = [
getEntity("light", "bed_light", "on", {
Expand Down Expand Up @@ -49,7 +40,7 @@ class DemoMoreInfoLight extends PolymerElement {
};
}

ready() {
public ready() {
super.ready();
const hass = provideHass(this);
hass.addEntities(ENTITIES);
Expand Down
79 changes: 79 additions & 0 deletions gallery/src/demos/demo-util-long-press.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import "@polymer/paper-button/paper-button";

import "../../../src/components/ha-card";
import { longPress } from "../../../src/panels/lovelace/common/directives/long-press-directive";

export class DemoUtilLongPress extends LitElement {
public render(): TemplateResult {
return html`
${this.renderStyle()}
${
[1, 2, 3].map(
() => html`
<ha-card>
<paper-button
@ha-click="${this._handleTap}"
@ha-hold="${this._handleHold}"
.longPress="${longPress()}"
>
(long) press me!
</paper-button>

<textarea></textarea>

<div>(try pressing and scrolling too!)</div>
</ha-card>
`
)
}
`;
}

private _handleTap(ev: Event) {
this._addValue(ev, "tap");
}

private _handleHold(ev: Event) {
this._addValue(ev, "hold");
}

private _addValue(ev: Event, value: string) {
const area = (ev.currentTarget as HTMLElement)
.nextElementSibling! as HTMLTextAreaElement;
const now = new Date().toTimeString().split(" ")[0];
area.value += `${now}: ${value}\n`;
area.scrollTop = area.scrollHeight;
}

private renderStyle() {
return html`
<style>
ha-card {
width: 200px;
margin: calc(42vh - 140px) auto;
padding: 8px;
text-align: center;
}
ha-card:first-of-type {
margin-top: 16px;
}
ha-card:last-of-type {
margin-bottom: 16px;
}

paper-button {
font-weight: bold;
color: var(--primary-color);
}

textarea {
height: 50px;
}
</style>
`;
}
}

customElements.define("demo-util-long-press", DemoUtilLongPress);
28 changes: 26 additions & 2 deletions gallery/src/ha-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";

import "../../src/managers/notification-manager";

const DEMOS = require.context("./demos", true, /^(.*\.(js$))[^.]*$/im);
const DEMOS = require.context("./demos", true, /^(.*\.(ts$))[^.]*$/im);

const fixPath = (path) => path.substr(2, path.length - 5);

Expand Down Expand Up @@ -118,6 +118,22 @@ class HaGallery extends PolymerElement {
</a>
</template>
</paper-card>

<paper-card heading="Util demos">
<div class='card-content intro'>
<p>
Test pages for our utility functions.
</p>
</div>
<template is='dom-repeat' items='[[_utilDemos]]'>
<a href='#[[item]]'>
<paper-item>
<paper-item-body>{{ item }}</paper-item-body>
<iron-icon icon="hass:chevron-right"></iron-icon>
</paper-item>
</a>
</template>
</paper-card>
</div>
</template>
</div>
Expand Down Expand Up @@ -145,6 +161,10 @@ class HaGallery extends PolymerElement {
type: Array,
computed: "_computeMoreInfos(_demos)",
},
_utilDemos: {
type: Array,
computed: "_computeUtil(_demos)",
},
};
}

Expand Down Expand Up @@ -178,7 +198,7 @@ class HaGallery extends PolymerElement {
while (root.lastChild) root.removeChild(root.lastChild);

if (demo) {
DEMOS(`./${demo}.js`);
DEMOS(`./${demo}.ts`);
const el = document.createElement(demo);
root.appendChild(el);
}
Expand All @@ -199,6 +219,10 @@ class HaGallery extends PolymerElement {
_computeMoreInfos(demos) {
return demos.filter((demo) => demo.includes("more-info"));
}

_computeUtil(demos) {
return demos.filter((demo) => demo.includes("util"));
}
}

customElements.define("ha-gallery", HaGallery);
14 changes: 10 additions & 4 deletions hassio/src/addon-view/hassio-addon-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import { ANSI_HTML_STYLE, parseTextToColoredPre } from "../ansi-to-html";

import "../../../src/resources/ha-style";

Expand All @@ -15,10 +16,13 @@ class HassioAddonLogs extends PolymerElement {
}
pre {
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
}
</style>
${ANSI_HTML_STYLE}
<paper-card heading="Log">
<div class="card-content"><pre>[[log]]</pre></div>
<div class="card-content" id="content"></div>
<div class="card-actions">
<paper-button on-click="refresh">Refresh</paper-button>
</div>
Expand All @@ -33,7 +37,6 @@ class HassioAddonLogs extends PolymerElement {
type: String,
observer: "addonSlugChanged",
},
log: String,
};
}

Expand All @@ -51,8 +54,11 @@ class HassioAddonLogs extends PolymerElement {
refresh() {
this.hass
.callApi("get", `hassio/addons/${this.addonSlug}/logs`)
.then((info) => {
this.log = info;
.then((text) => {
while (this.$.content.lastChild) {
this.$.content.removeChild(this.$.content.lastChild);
}
this.$.content.appendChild(parseTextToColoredPre(text));
});
}
}
Expand Down
Loading