Big restructuring - repo is now a full home assistant config directory

This commit is contained in:
Martin Bauer
2019-06-30 19:37:32 +02:00
parent d35b9e132e
commit 808727ad92
79 changed files with 14378 additions and 27 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,99 @@
class ToggleLockEntityRow extends Polymer.Element {
static get template() {
return Polymer.html`
<style>
hui-generic-entity-row {
margin: var(--ha-themed-slider-margin, initial);
}
.flex {
display: flex;
align-items: center;
}
#overlay {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: right;
z-index: 1;
}
#lock {
margin-top: 8px;
color: #3f3f3f;
opacity: 1;
margin-right: 7px;
-webkit-animation-duration: 5s;animation-duration 5s;
-webkit-animation-fill-mode: both;animation-full-mode: both;
}
.wrapper {
position: relative;
}
@keyframes fadeOut{
0% {opacity: 1;}
20% {opacity: 0;}
80% {opacity: 0;}
100% {opacity: 1;}
}
.fadeOut {
-webkit-animation-name: fadeOut;animation-name: fadeOut;
}
</style>
<hui-generic-entity-row
config="[[_config]]"
hass="[[_hass]]"
>
<div class="wrapper">
<div class="flex">
<ha-entity-toggle
state-obj="[[stateObj]]"
hass="[[_hass]]"
></ha-entity-toggle>
</div>
<div id="overlay" on-click='clickHandler'>
<iron-icon id="lock" icon="hass:lock"></iron-icon>
</div>
</div>
</hui-generic-entity-row>
`
}
setConfig(config)
{
this._config = config;
this.users = null;
if(config.users) {
this.users = config.users;
}
}
set hass(hass) {
this._hass = hass;
this.stateObj = this._config.entity in hass.states ? hass.states[this._config.entity] : null;
}
clickHandler(e) {
e.stopPropagation();
if(this.users) {
if(! document.querySelector("home-assistant").hass.user) return;
let user = document.querySelector("home-assistant").hass.user.name;
if(this.users.indexOf(user) < 0) return;
}
this.$.overlay.style.pointerEvents = 'none';
const lock = this.$.lock;
if(lock) {
lock.icon = 'hass:lock-open';
lock.classList.add('fadeOut');
}
window.setTimeout(() => {
this.$.overlay.style.pointerEvents = '';
if(lock) {
lock.classList.remove('fadeOut');
lock.icon = 'hass:lock';
}
}, 5000);
}
}
customElements.define('toggle-lock-entity-row', ToggleLockEntityRow);

BIN
www/img/bedroom.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

BIN
www/img/bedroom_16_9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 KiB

BIN
www/img/living_room.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
www/img/office_martin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB