Big restructuring - repo is now a full home assistant config directory
This commit is contained in:
1261
www/custom_ui/compact-custom-header.js
Normal file
1261
www/custom_ui/compact-custom-header.js
Normal file
File diff suppressed because it is too large
Load Diff
1
www/custom_ui/mini-graph-card-bundle.js
Normal file
1
www/custom_ui/mini-graph-card-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
www/custom_ui/mini-media-player-bundle.js
Normal file
1
www/custom_ui/mini-media-player-bundle.js
Normal file
File diff suppressed because one or more lines are too long
308
www/custom_ui/room-glance-card.js
Normal file
308
www/custom_ui/room-glance-card.js
Normal file
File diff suppressed because one or more lines are too long
207
www/custom_ui/state-card-custom-cover.js
Normal file
207
www/custom_ui/state-card-custom-cover.js
Normal file
File diff suppressed because one or more lines are too long
99
www/custom_ui/toggle-lock-entity-row.js
Normal file
99
www/custom_ui/toggle-lock-entity-row.js
Normal 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
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
BIN
www/img/bedroom_16_9.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
BIN
www/img/living_area_16_9.jpg
Normal file
BIN
www/img/living_area_16_9.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 548 KiB |
BIN
www/img/living_room.jpg
Normal file
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
BIN
www/img/office_martin.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
BIN
www/img/office_martin_16_9.jpg
Normal file
BIN
www/img/office_martin_16_9.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 977 KiB |
Reference in New Issue
Block a user