mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 09:56:36 +00:00
Remove no longer needed blocks (#1262)
This commit is contained in:
parent
4d48a63141
commit
10c997b7b2
@ -7,13 +7,12 @@ import computeStateName from '../common/entity/compute_state_name.js';
|
||||
import EventsMixin from '../mixins/events-mixin.js';
|
||||
import LocalizeMixin from '../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
const UPDATE_INTERVAL = 10000; // ms
|
||||
/*
|
||||
const UPDATE_INTERVAL = 10000; // ms
|
||||
/*
|
||||
* @appliesMixin LocalizeMixin
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class HaCameraCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
class HaCameraCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="paper-material-styles">
|
||||
@ -119,6 +118,5 @@ import LocalizeMixin from '../mixins/localize-mixin.js';
|
||||
_computeStateName(stateObj) {
|
||||
return computeStateName(stateObj);
|
||||
}
|
||||
}
|
||||
customElements.define('ha-camera-card', HaCameraCard);
|
||||
}
|
||||
customElements.define('ha-camera-card', HaCameraCard);
|
||||
|
@ -12,24 +12,23 @@ import computeStateDomain from '../common/entity/compute_state_domain.js';
|
||||
import splitByGroups from '../common/entity/split_by_groups.js';
|
||||
import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
|
||||
{
|
||||
// mapping domain to size of the card.
|
||||
const DOMAINS_WITH_CARD = {
|
||||
// mapping domain to size of the card.
|
||||
const DOMAINS_WITH_CARD = {
|
||||
camera: 4,
|
||||
history_graph: 4,
|
||||
media_player: 3,
|
||||
persistent_notification: 0,
|
||||
plant: 3,
|
||||
weather: 4,
|
||||
};
|
||||
};
|
||||
|
||||
// 4 types:
|
||||
// badges: 0 .. 10
|
||||
// before groups < 0
|
||||
// groups: X
|
||||
// rest: 100
|
||||
// 4 types:
|
||||
// badges: 0 .. 10
|
||||
// before groups < 0
|
||||
// groups: X
|
||||
// rest: 100
|
||||
|
||||
const PRIORITY = {
|
||||
const PRIORITY = {
|
||||
// before groups < 0
|
||||
configurator: -20,
|
||||
persistent_notification: -15,
|
||||
@ -43,15 +42,15 @@ import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
sensor: 5,
|
||||
binary_sensor: 6,
|
||||
mailbox: 7,
|
||||
};
|
||||
};
|
||||
|
||||
const getPriority = domain =>
|
||||
const getPriority = domain =>
|
||||
((domain in PRIORITY) ? PRIORITY[domain] : 100);
|
||||
|
||||
const sortPriority = (domainA, domainB) =>
|
||||
const sortPriority = (domainA, domainB) =>
|
||||
domainA.priority - domainB.priority;
|
||||
|
||||
const entitySortBy = (entityA, entityB) => {
|
||||
const entitySortBy = (entityA, entityB) => {
|
||||
const nameA = (entityA.attributes.friendly_name ||
|
||||
entityA.entity_id).toLowerCase();
|
||||
const nameB = (entityB.attributes.friendly_name ||
|
||||
@ -64,9 +63,9 @@ import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
};
|
||||
|
||||
const iterateDomainSorted = (collection, func) => {
|
||||
const iterateDomainSorted = (collection, func) => {
|
||||
Object.keys(collection)
|
||||
.map(key => collection[key])
|
||||
.sort(sortPriority)
|
||||
@ -74,9 +73,9 @@ import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
domain.states.sort(entitySortBy);
|
||||
func(domain);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
class HaCards extends PolymerElement {
|
||||
class HaCards extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="iron-flex iron-flex-factors"></style>
|
||||
@ -142,7 +141,7 @@ import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
@ -363,6 +362,5 @@ import getGroupEntities from '../common/entity/get_group_entities.js';
|
||||
|
||||
return cards;
|
||||
}
|
||||
}
|
||||
customElements.define('ha-cards', HaCards);
|
||||
}
|
||||
customElements.define('ha-cards', HaCards);
|
||||
|
@ -8,14 +8,13 @@ import computeStateDomain from '../common/entity/compute_state_domain.js';
|
||||
import computeStateDisplay from '../common/entity/compute_state_display.js';
|
||||
import LocalizeMixin from '../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
const RECENT_THRESHOLD = 60000; // 1 minute
|
||||
const RECENT_CACHE = {};
|
||||
const DOMAINS_USE_LAST_UPDATED = ['thermostat', 'climate'];
|
||||
const LINE_ATTRIBUTES_TO_KEEP = ['temperature', 'current_temperature', 'target_temp_low', 'target_temp_high'];
|
||||
const stateHistoryCache = {};
|
||||
const RECENT_THRESHOLD = 60000; // 1 minute
|
||||
const RECENT_CACHE = {};
|
||||
const DOMAINS_USE_LAST_UPDATED = ['thermostat', 'climate'];
|
||||
const LINE_ATTRIBUTES_TO_KEEP = ['temperature', 'current_temperature', 'target_temp_low', 'target_temp_high'];
|
||||
const stateHistoryCache = {};
|
||||
|
||||
function computeHistory(stateHistory, localize, language) {
|
||||
function computeHistory(stateHistory, localize, language) {
|
||||
const lineChartDevices = {};
|
||||
const timelineDevices = [];
|
||||
if (!stateHistory) {
|
||||
@ -96,12 +95,12 @@ import LocalizeMixin from '../mixins/localize-mixin.js';
|
||||
}));
|
||||
|
||||
return { line: unitStates, timeline: timelineDevices };
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin LocalizeMixin
|
||||
*/
|
||||
class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
|
||||
class HaStateHistoryData extends LocalizeMixin(PolymerElement) {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: {
|
||||
@ -383,6 +382,5 @@ import LocalizeMixin from '../mixins/localize-mixin.js';
|
||||
|
||||
return prom;
|
||||
}
|
||||
}
|
||||
customElements.define('ha-state-history-data', HaStateHistoryData);
|
||||
}
|
||||
customElements.define('ha-state-history-data', HaStateHistoryData);
|
||||
|
@ -12,11 +12,10 @@ import featureClassNames from '../../../common/entity/feature_class_names';
|
||||
|
||||
import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
const FEATURE_CLASS_NAMES = {
|
||||
const FEATURE_CLASS_NAMES = {
|
||||
128: 'has-set_tilt_position',
|
||||
};
|
||||
class MoreInfoCover extends LocalizeMixin(PolymerElement) {
|
||||
};
|
||||
class MoreInfoCover extends LocalizeMixin(PolymerElement) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="iron-flex"></style>
|
||||
@ -111,7 +110,6 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
coverTiltPositionSliderChanged(ev) {
|
||||
this.entityObj.setCoverTiltPosition(ev.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('more-info-cover', MoreInfoCover);
|
||||
}
|
||||
|
||||
customElements.define('more-info-cover', MoreInfoCover);
|
||||
|
@ -14,18 +14,17 @@ import featureClassNames from '../../../common/entity/feature_class_names';
|
||||
import EventsMixin from '../../../mixins/events-mixin.js';
|
||||
import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
const FEATURE_CLASS_NAMES = {
|
||||
const FEATURE_CLASS_NAMES = {
|
||||
1: 'has-brightness',
|
||||
2: 'has-color_temp',
|
||||
4: 'has-effect_list',
|
||||
16: 'has-color',
|
||||
128: 'has-white_value',
|
||||
};
|
||||
/*
|
||||
};
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
class MoreInfoLight extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="iron-flex"></style>
|
||||
@ -260,7 +259,6 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
colorPicked(ev) {
|
||||
this.serviceChangeColor(this.hass, this.stateObj.entity_id, ev.detail.hs);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('more-info-light', MoreInfoLight);
|
||||
}
|
||||
|
||||
customElements.define('more-info-light', MoreInfoLight);
|
||||
|
@ -16,11 +16,10 @@ import isComponentLoaded from '../../../common/config/is_component_loaded.js';
|
||||
import EventsMixin from '../../../mixins/events-mixin.js';
|
||||
import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class MoreInfoMediaPlayer extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
class MoreInfoMediaPlayer extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="iron-flex iron-flex-alignment"></style>
|
||||
@ -286,7 +285,6 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
this.ttsMessage = '';
|
||||
this.$.ttsInput.focus();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('more-info-media_player', MoreInfoMediaPlayer);
|
||||
}
|
||||
|
||||
customElements.define('more-info-media_player', MoreInfoMediaPlayer);
|
||||
|
@ -17,16 +17,15 @@ import isComponentLoaded from '../../common/config/is_component_loaded.js';
|
||||
import { DOMAINS_MORE_INFO_NO_HISTORY } from '../../common/const.js';
|
||||
import EventsMixin from '../../mixins/events-mixin.js';
|
||||
|
||||
{
|
||||
const DOMAINS_NO_INFO = [
|
||||
const DOMAINS_NO_INFO = [
|
||||
'camera',
|
||||
'configurator',
|
||||
'history_graph',
|
||||
];
|
||||
/*
|
||||
];
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class MoreInfoControls extends EventsMixin(PolymerElement) {
|
||||
class MoreInfoControls extends EventsMixin(PolymerElement) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="ha-style-dialog">
|
||||
@ -158,6 +157,5 @@ import EventsMixin from '../../mixins/events-mixin.js';
|
||||
_gotoSettings() {
|
||||
this.fire('more-info-page', { page: 'settings' });
|
||||
}
|
||||
}
|
||||
customElements.define('more-info-controls', MoreInfoControls);
|
||||
}
|
||||
customElements.define('more-info-controls', MoreInfoControls);
|
||||
|
@ -17,10 +17,9 @@ import(/* webpackChunkName: "ha-sidebar" */ '../components/ha-sidebar.js');
|
||||
import(/* webpackChunkName: "more-info-dialog" */ '../dialogs/ha-more-info-dialog.js');
|
||||
import(/* webpackChunkName: "voice-command-dialog" */ '../dialogs/ha-voice-command-dialog.js');
|
||||
|
||||
{
|
||||
const NON_SWIPABLE_PANELS = ['kiosk', 'map'];
|
||||
const NON_SWIPABLE_PANELS = ['kiosk', 'map'];
|
||||
|
||||
class HomeAssistantMain extends NavigateMixin(EventsMixin(PolymerElement)) {
|
||||
class HomeAssistantMain extends NavigateMixin(EventsMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style>
|
||||
@ -127,7 +126,6 @@ import(/* webpackChunkName: "voice-command-dialog" */ '../dialogs/ha-voice-comma
|
||||
_computeDisableSwipe(hass) {
|
||||
return NON_SWIPABLE_PANELS.indexOf(hass.panelUrl) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('home-assistant-main', HomeAssistantMain);
|
||||
}
|
||||
|
||||
customElements.define('home-assistant-main', HomeAssistantMain);
|
||||
|
@ -24,15 +24,14 @@ import computeLocationName from '../common/config/location_name.js';
|
||||
import NavigateMixin from '../mixins/navigate-mixin.js';
|
||||
import EventsMixin from '../mixins/events-mixin.js';
|
||||
|
||||
{
|
||||
const DEFAULT_VIEW_ENTITY_ID = 'group.default_view';
|
||||
const ALWAYS_SHOW_DOMAIN = ['persistent_notification', 'configurator'];
|
||||
const DEFAULT_VIEW_ENTITY_ID = 'group.default_view';
|
||||
const ALWAYS_SHOW_DOMAIN = ['persistent_notification', 'configurator'];
|
||||
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
* @appliesMixin NavigateMixin
|
||||
*/
|
||||
class PartialCards extends EventsMixin(NavigateMixin(PolymerElement)) {
|
||||
class PartialCards extends EventsMixin(NavigateMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include="iron-flex iron-positioning ha-style">
|
||||
@ -347,7 +346,6 @@ import EventsMixin from '../mixins/events-mixin.js';
|
||||
|
||||
return orderedGroupEntities;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('partial-cards', PartialCards);
|
||||
}
|
||||
|
||||
customElements.define('partial-cards', PartialCards);
|
||||
|
@ -12,20 +12,19 @@ import './ha-config-cloud-login.js';
|
||||
import './ha-config-cloud-register.js';
|
||||
import NavigateMixin from '../../../mixins/navigate-mixin.js';
|
||||
|
||||
{
|
||||
const LOGGED_IN_URLS = [
|
||||
const LOGGED_IN_URLS = [
|
||||
'/cloud/account',
|
||||
];
|
||||
const NOT_LOGGED_IN_URLS = [
|
||||
];
|
||||
const NOT_LOGGED_IN_URLS = [
|
||||
'/cloud/login',
|
||||
'/cloud/register',
|
||||
'/cloud/forgot-password',
|
||||
];
|
||||
];
|
||||
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin NavigateMixin
|
||||
*/
|
||||
class HaConfigCloud extends NavigateMixin(PolymerElement) {
|
||||
class HaConfigCloud extends NavigateMixin(PolymerElement) {
|
||||
static get template() {
|
||||
return html`
|
||||
<app-route route="[[route]]" pattern="/cloud/:page" data="{{_routeData}}" tail="{{_routeTail}}"></app-route>
|
||||
@ -105,7 +104,6 @@ import NavigateMixin from '../../../mixins/navigate-mixin.js';
|
||||
_equals(a, b) {
|
||||
return a === b;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-config-cloud', HaConfigCloud);
|
||||
}
|
||||
|
||||
customElements.define('ha-config-cloud', HaConfigCloud);
|
||||
|
@ -13,12 +13,11 @@ import './ha-config-flow.js';
|
||||
import EventsMixin from '../../../mixins/events-mixin.js';
|
||||
import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin LocalizeMixin
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class HaConfigManager extends
|
||||
class HaConfigManager extends
|
||||
LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
@ -198,7 +197,6 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
_computeIntegrationTitle(localize, integration) {
|
||||
return localize(`component.${integration}.config.title`);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-config-entries', HaConfigManager);
|
||||
}
|
||||
|
||||
customElements.define('ha-config-entries', HaConfigManager);
|
||||
|
@ -11,16 +11,15 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||
|
||||
import isComponentLoaded from '../../../common/config/is_component_loaded.js';
|
||||
|
||||
{
|
||||
const CORE_PAGES = [
|
||||
const CORE_PAGES = [
|
||||
'core',
|
||||
'customize',
|
||||
];
|
||||
/*
|
||||
];
|
||||
/*
|
||||
* @appliesMixin LocalizeMixin
|
||||
* @appliesMixin NavigateMixin
|
||||
*/
|
||||
class HaConfigNavigation extends
|
||||
class HaConfigNavigation extends
|
||||
LocalizeMixin(NavigateMixin(PolymerElement)) {
|
||||
static get template() {
|
||||
return html`
|
||||
@ -82,7 +81,6 @@ import isComponentLoaded from '../../../common/config/is_component_loaded.js';
|
||||
_navigate(ev) {
|
||||
this.navigate('/config/' + ev.model.item);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-config-navigation', HaConfigNavigation);
|
||||
}
|
||||
|
||||
customElements.define('ha-config-navigation', HaConfigNavigation);
|
||||
|
@ -12,9 +12,8 @@ import '../../components/ha-service-picker.js';
|
||||
import '../../resources/ha-style.js';
|
||||
import '../../util/app-localstorage-document.js';
|
||||
|
||||
{
|
||||
const ERROR_SENTINEL = {};
|
||||
class HaPanelDevService extends PolymerElement {
|
||||
const ERROR_SENTINEL = {};
|
||||
class HaPanelDevService extends PolymerElement {
|
||||
static get template() {
|
||||
return html`
|
||||
<style include='ha-style'>
|
||||
@ -298,7 +297,6 @@ import '../../util/app-localstorage-document.js';
|
||||
entity_id: ev.target.value
|
||||
}), null, 2);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-panel-dev-service', HaPanelDevService);
|
||||
}
|
||||
|
||||
customElements.define('ha-panel-dev-service', HaPanelDevService);
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||
|
||||
{
|
||||
var DATE_CACHE = {};
|
||||
var DATE_CACHE = {};
|
||||
|
||||
class HaLogbookData extends PolymerElement {
|
||||
class HaLogbookData extends PolymerElement {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: {
|
||||
@ -70,7 +69,6 @@ import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||
DATE_CACHE[this.filterDate] = null;
|
||||
this.filterDateChanged(this.filterDate);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('ha-logbook-data', HaLogbookData);
|
||||
}
|
||||
|
||||
customElements.define('ha-logbook-data', HaLogbookData);
|
||||
|
@ -1,13 +1,12 @@
|
||||
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||
|
||||
{
|
||||
const STORED_STATE = [
|
||||
const STORED_STATE = [
|
||||
'dockedSidebar',
|
||||
'selectedTheme',
|
||||
'selectedLanguage',
|
||||
];
|
||||
];
|
||||
|
||||
class HaPrefStorage extends PolymerElement {
|
||||
class HaPrefStorage extends PolymerElement {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: Object,
|
||||
@ -44,6 +43,5 @@ import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||
|
||||
return state;
|
||||
}
|
||||
}
|
||||
customElements.define('ha-pref-storage', HaPrefStorage);
|
||||
}
|
||||
customElements.define('ha-pref-storage', HaPrefStorage);
|
||||
|
@ -2,14 +2,13 @@ import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||
|
||||
import EventsMixin from '../mixins/events-mixin.js';
|
||||
|
||||
{
|
||||
/* eslint-disable no-console */
|
||||
const DEBUG = false;
|
||||
/* eslint-disable no-console */
|
||||
const DEBUG = false;
|
||||
|
||||
/*
|
||||
/*
|
||||
* @appliesMixin EventsMixin
|
||||
*/
|
||||
class HaUrlSync extends EventsMixin(PolymerElement) {
|
||||
class HaUrlSync extends EventsMixin(PolymerElement) {
|
||||
static get properties() {
|
||||
return {
|
||||
hass: {
|
||||
@ -70,6 +69,5 @@ import EventsMixin from '../mixins/events-mixin.js';
|
||||
super.disconnectedCallback();
|
||||
window.removeEventListener('popstate', this.popstateChangeListener);
|
||||
}
|
||||
}
|
||||
customElements.define('ha-url-sync', HaUrlSync);
|
||||
}
|
||||
customElements.define('ha-url-sync', HaUrlSync);
|
||||
|
Loading…
x
Reference in New Issue
Block a user