From 51ea699d6c0683e86419e21f67f8656a34f65531 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Thu, 7 Jan 2021 10:18:00 +0000 Subject: [PATCH 1/2] Sort imports --- .devcontainer/devcontainer.json | 11 ++++- cast/src/receiver/layout/hc-demo.ts | 2 +- cast/src/receiver/second-load.ts | 2 +- demo/src/custom-cards/cast-demo-row.ts | 2 +- demo/src/custom-cards/ha-demo-card.ts | 2 +- demo/src/entrypoint.ts | 2 +- demo/src/ha-demo.ts | 2 +- gallery/src/components/demo-cards.js | 4 +- gallery/src/components/demo-more-info.js | 2 +- gallery/src/components/demo-more-infos.js | 4 +- .../src/demos/demo-hui-alarm-panel-card.ts | 2 +- .../src/demos/demo-hui-conditional-card.ts | 2 +- gallery/src/demos/demo-hui-entities-card.ts | 2 +- .../src/demos/demo-hui-entity-button-card.ts | 4 +- .../src/demos/demo-hui-entity-filter-card.ts | 2 +- gallery/src/demos/demo-hui-gauge-card.ts | 2 +- gallery/src/demos/demo-hui-glance-card.ts | 2 +- gallery/src/demos/demo-hui-iframe-card.ts | 2 +- gallery/src/demos/demo-hui-light-card.ts | 2 +- gallery/src/demos/demo-hui-map-card.ts | 2 +- gallery/src/demos/demo-hui-markdown-card.ts | 2 +- .../src/demos/demo-hui-media-control-card.ts | 2 +- .../src/demos/demo-hui-media-player-rows.ts | 8 ++-- .../demos/demo-hui-picture-elements-card.ts | 2 +- .../src/demos/demo-hui-picture-entity-card.ts | 2 +- .../src/demos/demo-hui-picture-glance-card.ts | 2 +- gallery/src/demos/demo-hui-plant-card.ts | 2 +- .../src/demos/demo-hui-shopping-list-card.ts | 2 +- gallery/src/demos/demo-hui-stack-card.ts | 2 +- gallery/src/demos/demo-hui-thermostat-card.ts | 2 +- gallery/src/demos/demo-more-info-light.ts | 8 ++-- .../addon-view/config/hassio-addon-audio.ts | 4 +- .../config/hassio-addon-config-tab.ts | 2 +- .../src/addon-view/hassio-addon-dashboard.ts | 2 +- .../addon-view/info/hassio-addon-info-tab.ts | 2 +- .../addon-view/log/hassio-addon-log-tab.ts | 2 +- .../markdown/dialog-hassio-markdown.ts | 2 +- hassio/src/entrypoint.ts | 2 +- hassio/src/hassio-main.ts | 10 ++-- .../src/ingress-view/hassio-ingress-view.ts | 10 ++-- src/auth/ha-auth-flow.ts | 2 +- src/auth/ha-authorize.ts | 8 ++-- src/common/config/can_show_page.ts | 2 +- src/common/entity/compute_state_display.ts | 2 +- src/common/entity/state_card_type.ts | 2 +- src/common/image/extract_color.ts | 6 +-- src/common/search/search-input.ts | 4 +- src/common/translations/localize.ts | 2 +- src/components/buttons/ha-progress-button.ts | 3 +- src/components/data-table/sort-filter.ts | 1 - src/components/date-range-picker.ts | 6 +-- .../device/ha-area-devices-picker.ts | 8 ++-- .../device/ha-device-automation-picker.ts | 2 +- src/components/device/ha-device-picker.ts | 4 +- src/components/entity/ha-battery-icon.ts | 2 +- .../entity/ha-entity-attribute-picker.ts | 4 +- src/components/entity/ha-entity-toggle.ts | 6 +-- src/components/entity/ha-state-label-badge.ts | 6 +-- src/components/entity/state-badge.ts | 3 -- src/components/entity/state-info.ts | 4 +- src/components/ha-area-picker.ts | 26 +++++----- src/components/ha-bar.ts | 1 - src/components/ha-button-toggle-group.ts | 2 +- src/components/ha-circular-progress.ts | 2 +- src/components/ha-climate-control.js | 2 +- src/components/ha-climate-state.ts | 5 +- src/components/ha-code-editor.ts | 38 +++++++-------- src/components/ha-combo-box.js | 2 +- src/components/ha-cover-controls.ts | 8 ++-- src/components/ha-cover-tilt-controls.ts | 12 ++--- src/components/ha-date-range-picker.ts | 20 ++++---- src/components/ha-expansion-panel.ts | 4 +- src/components/ha-fab.ts | 2 +- src/components/ha-form/ha-form-constant.ts | 8 ++-- .../ha-form/ha-form-multi_select.ts | 4 +- src/components/ha-form/ha-form-string.ts | 4 +- src/components/ha-form/ha-form.ts | 2 +- src/components/ha-gauge.ts | 13 +++-- src/components/ha-icon-button-arrow-next.ts | 12 ++--- src/components/ha-icon-button-arrow-prev.ts | 12 ++--- src/components/ha-icon-button-next.ts | 12 ++--- src/components/ha-icon-button-prev.ts | 12 ++--- src/components/ha-icon-button.ts | 8 ++-- src/components/ha-icon-next.ts | 2 +- src/components/ha-icon-prev.ts | 2 +- src/components/ha-icon.ts | 22 ++++----- src/components/ha-markdown.ts | 1 - .../ha-push-notifications-toggle.js | 2 +- src/components/ha-related-items.ts | 2 +- src/components/ha-relative-time.ts | 4 +- .../ha-selector/ha-selector-action.ts | 4 +- .../ha-selector/ha-selector-area.ts | 6 +-- .../ha-selector/ha-selector-device.ts | 6 +-- .../ha-selector/ha-selector-entity.ts | 8 ++-- .../ha-selector/ha-selector-number.ts | 8 ++-- .../ha-selector/ha-selector-target.ts | 18 +++---- .../ha-selector/ha-selector-time.ts | 4 +- src/components/ha-selector/ha-selector.ts | 13 +++-- src/components/ha-svg-icon.ts | 2 +- src/components/ha-tab.ts | 16 +++---- src/components/ha-tabs.ts | 2 +- src/components/ha-target-picker.ts | 48 +++++++++---------- src/components/ha-water_heater-control.js | 2 +- src/components/ha-yaml-editor.ts | 2 +- src/components/map/ha-locations-editor.ts | 2 +- src/components/map/ha-map.ts | 4 +- .../media-player/ha-media-player-browse.ts | 2 +- src/components/state-history-charts.js | 2 +- src/components/user/ha-user-picker.ts | 2 +- src/components/user/ha-users-picker.ts | 8 ++-- src/data/area_registry.ts | 2 +- src/data/calendar.ts | 4 +- src/data/device_automation.ts | 2 +- src/data/iconsets.ts | 2 +- src/data/media-player.ts | 2 +- src/data/tag.ts | 2 +- .../dialog-config-entry-system-options.ts | 10 ++-- .../config-flow/step-flow-pick-handler.ts | 4 +- .../image-cropper-dialog.ts | 2 +- .../controls/more-info-automation.ts | 2 +- .../more-info/controls/more-info-camera.ts | 2 +- .../controls/more-info-configurator.js | 2 +- .../more-info/controls/more-info-counter.ts | 2 +- .../more-info/controls/more-info-fan.js | 2 +- .../more-info/controls/more-info-group.ts | 8 ++-- .../controls/more-info-input_datetime.js | 2 +- .../more-info/controls/more-info-light.ts | 2 +- .../controls/more-info-media_player.ts | 2 +- .../more-info/controls/more-info-vacuum.ts | 4 +- .../more-info/controls/more-info-weather.ts | 28 +++++------ src/dialogs/more-info/ha-more-info-dialog.ts | 5 +- src/dialogs/more-info/more-info-content.ts | 5 +- .../notifications/notification-drawer.js | 4 +- src/dialogs/quick-bar/ha-quick-bar.ts | 10 ++-- .../ha-voice-command-dialog.ts | 4 +- src/entrypoints/app.ts | 4 +- src/entrypoints/authorize.ts | 4 +- src/entrypoints/core.ts | 4 +- src/entrypoints/custom-panel.ts | 4 +- src/entrypoints/onboarding.ts | 4 +- src/entrypoints/service_worker.ts | 8 ++-- src/layouts/ha-init-page.ts | 2 +- src/layouts/hass-error-screen.ts | 2 +- src/layouts/hass-loading-screen.ts | 2 +- src/layouts/hass-subpage.ts | 6 +-- src/layouts/home-assistant.ts | 6 +-- src/managers/notification-manager.ts | 2 +- src/panels/calendar/ha-full-calendar.ts | 4 +- .../areas/dialog-area-registry-detail.ts | 4 +- .../config/areas/ha-config-areas-dashboard.ts | 2 +- src/panels/config/areas/ha-config-areas.ts | 2 +- .../types/ha-automation-action-device_id.ts | 4 +- .../automation/blueprint-automation-editor.ts | 28 +++++------ .../ha-automation-condition-editor.ts | 6 +-- .../types/ha-automation-condition-device.ts | 6 +-- .../types/ha-automation-condition-template.ts | 2 +- .../types/ha-automation-condition-time.ts | 10 ++-- .../automation/dialog-new-automation.ts | 16 +++---- .../config/automation/ha-automation-editor.ts | 16 +++---- .../config/automation/ha-automation-picker.ts | 12 ++--- .../config/automation/ha-config-automation.ts | 2 +- .../automation/manual-automation-editor.ts | 22 ++++----- .../automation/thingtalk/dialog-thingtalk.ts | 6 +-- .../thingtalk/ha-thingtalk-placeholders.ts | 4 +- .../types/ha-automation-trigger-device.ts | 6 +-- .../types/ha-automation-trigger-event.ts | 4 +- .../types/ha-automation-trigger-tag.ts | 6 +-- .../types/ha-automation-trigger-template.ts | 2 +- .../blueprint/dialog-import-blueprint.ts | 14 +++--- .../config/blueprint/ha-blueprint-overview.ts | 24 +++++----- .../config/blueprint/ha-config-blueprint.ts | 4 +- .../config/cloud/account/cloud-account.js | 2 +- .../config/cloud/account/cloud-alexa-pref.ts | 2 +- .../dialog-manage-cloudhook.ts | 2 +- .../cloud-google-assistant.ts | 2 +- src/panels/config/cloud/ha-config-cloud.ts | 2 +- src/panels/config/cloud/login/cloud-login.js | 4 +- src/panels/config/core/ha-config-core-form.ts | 2 +- src/panels/config/core/ha-config-core.js | 2 +- src/panels/config/core/ha-config-name-form.ts | 2 +- .../config/core/ha-config-section-core.js | 1 - src/panels/config/core/ha-config-url-form.ts | 2 +- .../config/customize/ha-config-customize.js | 2 +- .../customize/ha-customize-attribute.js | 2 +- .../config/dashboard/ha-config-dashboard.ts | 6 +-- .../ha-device-automation-dialog.ts | 2 +- .../device-detail/ha-device-entities-card.ts | 2 +- .../device-detail/ha-device-info-card.ts | 2 +- .../mqtt/dialog-mqtt-device-debug-info.ts | 6 +-- .../mqtt/ha-device-actions-mqtt.ts | 4 +- .../mqtt/mqtt-discovery-payload.ts | 2 +- .../mqtt/mqtt-messages.ts | 4 +- .../ozw/ha-device-actions-ozw.ts | 12 ++--- .../ozw/ha-device-info-ozw.ts | 12 ++--- .../tasmota/ha-device-actions-tasmota.ts | 2 +- .../zha/ha-device-actions-zha.ts | 16 +++---- .../zha/ha-device-info-zha.ts | 8 ++-- .../dialog-device-registry-detail.ts | 20 ++++---- .../config/devices/ha-config-device-page.ts | 12 ++--- .../devices/ha-config-devices-dashboard.ts | 6 +-- .../config/devices/ha-config-devices.ts | 2 +- .../config/entities/dialog-entity-editor.ts | 2 +- .../settings/entity-settings-helper-tab.ts | 16 +++---- .../entities/entity-registry-basic-editor.ts | 16 +++---- .../entities/entity-registry-settings.ts | 20 ++++---- .../config/entities/ha-config-entities.ts | 22 ++++----- src/panels/config/ha-panel-config.ts | 44 ++++++++--------- src/panels/config/helpers/const.ts | 2 +- .../config/helpers/dialog-helper-detail.ts | 4 +- .../helpers/forms/ha-input_boolean-form.ts | 2 +- .../helpers/forms/ha-input_datetime-form.ts | 2 +- .../helpers/forms/ha-input_select-form.ts | 4 +- .../helpers/forms/ha-input_text-form.ts | 2 +- .../config/helpers/forms/ha-timer-form.ts | 4 +- .../config/helpers/ha-config-helpers.ts | 2 +- src/panels/config/info/ha-config-info.ts | 6 +-- src/panels/config/info/integrations-card.ts | 2 +- .../integrations/ha-config-integrations.ts | 4 +- .../integrations/ha-integration-card.ts | 32 ++++++------- .../mqtt/mqtt-config-panel.ts | 8 ++-- .../mqtt/mqtt-subscribe-card.ts | 2 +- .../ozw/dialog-ozw-refresh-node.ts | 19 ++++---- .../ozw/ozw-config-dashboard.ts | 4 +- .../ozw/ozw-network-router.ts | 4 +- .../integration-panels/ozw/ozw-node-config.ts | 18 +++---- .../ozw/ozw-node-dashboard.ts | 14 +++--- .../zha/dialog-zha-cluster.ts | 18 +++---- .../zha/dialog-zha-device-zigbee-info.ts | 2 +- .../zha/zha-add-devices-page.ts | 22 ++++----- .../zha/zha-add-group-page.ts | 6 +-- .../zha/zha-cluster-attributes.ts | 4 +- .../zha/zha-cluster-commands.ts | 4 +- .../zha/zha-clusters-data-table.ts | 2 +- .../integration-panels/zha/zha-clusters.ts | 4 +- .../zha/zha-config-dashboard-router.ts | 2 +- .../zha/zha-config-dashboard.ts | 12 ++--- .../zha/zha-device-binding.ts | 4 +- .../zha/zha-device-endpoint-data-table.ts | 8 ++-- .../zha/zha-device-pairing-status-card.ts | 6 +-- .../zha/zha-group-binding.ts | 4 +- .../integration-panels/zha/zha-group-page.ts | 8 ++-- .../zha/zha-groups-dashboard.ts | 18 +++---- .../zha/zha-network-visualization-page.ts | 13 +++-- .../zwave/ha-config-zwave.js | 4 +- .../integration-panels/zwave/zwave-log.js | 2 +- .../zwave/zwave-node-config.ts | 2 +- .../integration-panels/zwave/zwave-values.ts | 2 +- .../config/logs/dialog-system-log-detail.ts | 6 +-- src/panels/config/logs/error-log-card.ts | 4 +- src/panels/config/logs/ha-config-logs.ts | 4 +- src/panels/config/logs/system-log-card.ts | 6 +-- .../dialog-lovelace-dashboard-detail.ts | 10 ++-- .../ha-config-lovelace-dashboards.ts | 2 +- .../dialog-lovelace-resource-detail.ts | 2 +- .../resources/ha-config-lovelace-resources.ts | 2 +- .../config/person/dialog-person-detail.ts | 24 +++++----- src/panels/config/person/ha-config-person.ts | 2 +- src/panels/config/scene/ha-config-scene.ts | 2 +- src/panels/config/scene/ha-scene-dashboard.ts | 4 +- src/panels/config/scene/ha-scene-editor.ts | 16 +++---- src/panels/config/script/ha-config-script.ts | 4 +- src/panels/config/script/ha-script-editor.ts | 12 ++--- src/panels/config/script/ha-script-picker.ts | 10 ++-- src/panels/config/tags/dialog-tag-detail.ts | 1 - src/panels/config/tags/ha-config-tags.ts | 2 +- src/panels/config/tags/tag-image.ts | 10 ++-- src/panels/config/users/dialog-user-detail.ts | 2 +- src/panels/config/users/ha-config-users.ts | 2 +- src/panels/config/zone/dialog-zone-detail.ts | 6 +-- src/panels/custom/ha-panel-custom.ts | 2 +- .../event/developer-tools-event.js | 2 +- .../event/event-subscribe-card.ts | 2 +- .../ha-panel-developer-tools.ts | 6 +-- .../service/developer-tools-service.js | 2 +- .../state/developer-tools-state.js | 8 ++-- src/panels/history/ha-panel-history.ts | 22 ++++----- .../badges/hui-entity-filter-badge.ts | 12 ++--- src/panels/lovelace/badges/hui-error-badge.ts | 2 +- src/panels/lovelace/cards/hui-button-card.ts | 2 +- src/panels/lovelace/cards/hui-entity-card.ts | 6 +-- .../lovelace/cards/hui-entity-filter-card.ts | 14 +++--- src/panels/lovelace/cards/hui-error-card.ts | 4 +- src/panels/lovelace/cards/hui-gauge-card.ts | 2 +- .../cards/hui-horizontal-stack-card.ts | 5 +- .../lovelace/cards/hui-media-control-card.ts | 6 +-- .../lovelace/cards/hui-shopping-list-card.ts | 8 ++-- src/panels/lovelace/cards/hui-stack-card.ts | 2 +- .../lovelace/cards/hui-starting-card.ts | 8 ++-- .../lovelace/cards/hui-vertical-stack-card.ts | 5 +- .../cards/hui-weather-forecast-card.ts | 2 +- src/panels/lovelace/common/handle-action.ts | 2 +- .../lovelace/common/structs/is-entity-id.ts | 2 +- src/panels/lovelace/common/structs/is-icon.ts | 2 +- .../lovelace/common/validate-condition.ts | 2 +- .../lovelace/components/hui-buttons-base.ts | 13 ++--- .../components/hui-conditional-base.ts | 2 +- .../lovelace/components/hui-graph-base.ts | 2 +- .../components/hui-input-list-editor.ts | 2 +- .../components/hui-timestamp-display.ts | 2 +- .../lovelace/components/hui-views-list.ts | 2 +- src/panels/lovelace/custom-card-helpers.ts | 2 +- .../lovelace/editor/add-entities-to-view.ts | 6 +-- .../editor/card-editor/hui-card-preview.ts | 4 +- .../card-editor/hui-dialog-delete-card.ts | 2 +- .../card-editor/hui-entity-picker-table.ts | 2 +- .../hui-media-control-card-editor.ts | 4 +- .../hui-shopping-list-editor.ts | 4 +- .../config-elements/hui-stack-card-editor.ts | 4 +- .../hui-weather-forecast-card-editor.ts | 2 +- .../hui-dialog-edit-lovelace.ts | 4 +- .../select-view/hui-dialog-select-view.ts | 20 ++++---- .../unused-entities/hui-unused-entities.ts | 17 +++---- .../view-editor/hui-dialog-edit-view.ts | 6 +-- .../view-editor/show-edit-view-dialog.ts | 2 +- .../elements/hui-service-button-element.ts | 2 +- .../entity-rows/hui-climate-entity-row.ts | 2 +- .../entity-rows/hui-cover-entity-row.ts | 2 +- .../hui-input-datetime-entity-row.ts | 6 +-- .../hui-input-number-entity-row.ts | 4 +- .../hui-input-select-entity-row.ts | 2 +- .../entity-rows/hui-input-text-entity-row.ts | 2 +- .../entity-rows/hui-lock-entity-row.ts | 2 +- .../hui-media-player-entity-row.ts | 16 +++---- .../entity-rows/hui-scene-entity-row.ts | 2 +- .../entity-rows/hui-script-entity-row.ts | 4 +- .../entity-rows/hui-sensor-entity-row.ts | 14 +++--- .../entity-rows/hui-text-entity-row.ts | 18 +++---- .../entity-rows/hui-toggle-entity-row.ts | 2 +- .../entity-rows/hui-weather-entity-row.ts | 23 +++++---- src/panels/lovelace/ha-panel-lovelace.ts | 2 +- .../hui-picture-header-footer.ts | 2 +- src/panels/lovelace/header-footer/types.ts | 2 +- .../special-rows/hui-attribute-row.ts | 7 ++- .../lovelace/special-rows/hui-buttons-row.ts | 2 +- .../lovelace/special-rows/hui-cast-row.ts | 4 +- .../lovelace/special-rows/hui-text-row.ts | 2 +- .../lovelace/special-rows/hui-weblink-row.ts | 2 +- .../mailbox/ha-dialog-show-audio-message.js | 2 +- src/panels/mailbox/ha-panel-mailbox.js | 4 +- src/panels/map/ha-panel-map.js | 6 +-- .../hui-dialog-web-browser-play-media.ts | 2 +- src/panels/profile/ha-advanced-mode-row.ts | 2 +- src/panels/profile/ha-change-password-card.ts | 6 +-- src/panels/profile/ha-enable-shortcuts-row.ts | 2 +- src/panels/profile/ha-force-narrow-row.ts | 2 +- .../profile/ha-mfa-module-setup-flow.js | 2 +- src/panels/profile/ha-mfa-modules-card.js | 2 +- src/panels/profile/ha-panel-profile.ts | 2 +- src/panels/profile/ha-pick-dashboard-row.ts | 4 +- src/panels/profile/ha-pick-language-row.js | 2 +- .../profile/ha-push-notifications-row.js | 2 +- src/panels/profile/ha-set-suspend-row.ts | 2 +- src/panels/profile/ha-set-vibrate-row.ts | 2 +- .../shopping-list/ha-panel-shopping-list.ts | 16 +++---- src/resources/compatibility.ts | 8 ++-- src/resources/markdown_worker.ts | 2 +- src/resources/render-markdown.ts | 1 - src/state-summary/state-card-script.ts | 14 +++--- src/state/connection-mixin.ts | 2 +- src/state/dialog-manager-mixin.ts | 2 +- src/state/disconnect-toast-mixin.ts | 8 ++-- src/state/hass-element.ts | 2 +- src/state/more-info-mixin.ts | 6 +-- src/state/quick-bar-mixin.ts | 4 +- 364 files changed, 1048 insertions(+), 1072 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 78d39cd4159e..b00d00ac0b18 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,7 +24,16 @@ "editor.formatOnSave": true, "editor.formatOnType": true, "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.organizeImports": true + } }, "files.trimTrailingWhitespace": true } diff --git a/cast/src/receiver/layout/hc-demo.ts b/cast/src/receiver/layout/hc-demo.ts index 5852111743ad..b4ddc41a673f 100644 --- a/cast/src/receiver/layout/hc-demo.ts +++ b/cast/src/receiver/layout/hc-demo.ts @@ -1,8 +1,8 @@ import { customElement, html, - property, internalProperty, + property, TemplateResult, } from "lit-element"; import { mockHistory } from "../../../../demo/src/stubs/history"; diff --git a/cast/src/receiver/second-load.ts b/cast/src/receiver/second-load.ts index bb691527f646..e3c0885561d5 100644 --- a/cast/src/receiver/second-load.ts +++ b/cast/src/receiver/second-load.ts @@ -1,4 +1,4 @@ import "web-animations-js/web-animations-next-lite.min"; -import "../../../src/resources/roboto"; import "../../../src/resources/ha-style"; +import "../../../src/resources/roboto"; import "./layout/hc-lovelace"; diff --git a/demo/src/custom-cards/cast-demo-row.ts b/demo/src/custom-cards/cast-demo-row.ts index 04a0630418f6..ea0f3033a33d 100644 --- a/demo/src/custom-cards/cast-demo-row.ts +++ b/demo/src/custom-cards/cast-demo-row.ts @@ -3,8 +3,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import { CastManager } from "../../../src/cast/cast_manager"; diff --git a/demo/src/custom-cards/ha-demo-card.ts b/demo/src/custom-cards/ha-demo-card.ts index ad909a4e4fef..8da813d7bd0e 100644 --- a/demo/src/custom-cards/ha-demo-card.ts +++ b/demo/src/custom-cards/ha-demo-card.ts @@ -3,9 +3,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { until } from "lit-html/directives/until"; diff --git a/demo/src/entrypoint.ts b/demo/src/entrypoint.ts index a42ae3ccb1c8..e71ff28e8828 100644 --- a/demo/src/entrypoint.ts +++ b/demo/src/entrypoint.ts @@ -1,8 +1,8 @@ -import "../../src/resources/safari-14-attachshadow-patch"; import "@polymer/polymer/lib/elements/dom-if"; import "@polymer/polymer/lib/elements/dom-repeat"; import "../../src/resources/ha-style"; import "../../src/resources/roboto"; +import "../../src/resources/safari-14-attachshadow-patch"; import "./ha-demo"; /* polyfill for paper-dropdown */ diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index c49d522d654e..0ad775e0c403 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -1,4 +1,3 @@ -import "../../src/resources/compatibility"; import { isNavigationClick } from "../../src/common/dom/is-navigation-click"; import { navigate } from "../../src/common/navigate"; import { @@ -6,6 +5,7 @@ import { provideHass, } from "../../src/fake_data/provide_hass"; import { HomeAssistantAppEl } from "../../src/layouts/home-assistant"; +import "../../src/resources/compatibility"; import { HomeAssistant } from "../../src/types"; import { selectedDemoConfig } from "./configs/demo-configs"; import { mockAuth } from "./stubs/auth"; diff --git a/gallery/src/components/demo-cards.js b/gallery/src/components/demo-cards.js index 9e076371c414..59faa671a6ad 100644 --- a/gallery/src/components/demo-cards.js +++ b/gallery/src/components/demo-cards.js @@ -2,10 +2,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import "../../../src/components/ha-switch"; +import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element"; import "../../../src/components/ha-formfield"; +import "../../../src/components/ha-switch"; import "./demo-card"; -import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element"; class DemoCards extends PolymerElement { static get template() { diff --git a/gallery/src/components/demo-more-info.js b/gallery/src/components/demo-more-info.js index 49605c3a16a8..9e2fe30b2225 100644 --- a/gallery/src/components/demo-more-info.js +++ b/gallery/src/components/demo-more-info.js @@ -2,8 +2,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import "../../../src/components/ha-card"; -import "../../../src/state-summary/state-card-content"; import "../../../src/dialogs/more-info/more-info-content"; +import "../../../src/state-summary/state-card-content"; class DemoMoreInfo extends PolymerElement { static get template() { diff --git a/gallery/src/components/demo-more-infos.js b/gallery/src/components/demo-more-infos.js index 55b7e8477731..26d5fd002f10 100644 --- a/gallery/src/components/demo-more-infos.js +++ b/gallery/src/components/demo-more-infos.js @@ -2,10 +2,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import "../../../src/components/ha-switch"; +import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element"; import "../../../src/components/ha-formfield"; +import "../../../src/components/ha-switch"; import "./demo-more-info"; -import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element"; class DemoMoreInfos extends PolymerElement { static get template() { diff --git a/gallery/src/demos/demo-hui-alarm-panel-card.ts b/gallery/src/demos/demo-hui-alarm-panel-card.ts index 839533f6bcdf..4c66b22559d5 100644 --- a/gallery/src/demos/demo-hui-alarm-panel-card.ts +++ b/gallery/src/demos/demo-hui-alarm-panel-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-conditional-card.ts b/gallery/src/demos/demo-hui-conditional-card.ts index c0c7dce2c64e..cf70db64aa06 100644 --- a/gallery/src/demos/demo-hui-conditional-card.ts +++ b/gallery/src/demos/demo-hui-conditional-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-entities-card.ts b/gallery/src/demos/demo-hui-entities-card.ts index c43160610af7..7511e061b520 100644 --- a/gallery/src/demos/demo-hui-entities-card.ts +++ b/gallery/src/demos/demo-hui-entities-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-entity-button-card.ts b/gallery/src/demos/demo-hui-entity-button-card.ts index a3abad9af81d..1e3201fa10a6 100644 --- a/gallery/src/demos/demo-hui-entity-button-card.ts +++ b/gallery/src/demos/demo-hui-entity-button-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, @@ -53,7 +53,7 @@ const CONFIGS = [ config: ` - type: button entity: light.bed_light - tap_action: + tap_action: action: toggle `, }, diff --git a/gallery/src/demos/demo-hui-entity-filter-card.ts b/gallery/src/demos/demo-hui-entity-filter-card.ts index d23482127fbb..c34f7f263a68 100644 --- a/gallery/src/demos/demo-hui-entity-filter-card.ts +++ b/gallery/src/demos/demo-hui-entity-filter-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-gauge-card.ts b/gallery/src/demos/demo-hui-gauge-card.ts index 863341f08e86..35e794f317ad 100644 --- a/gallery/src/demos/demo-hui-gauge-card.ts +++ b/gallery/src/demos/demo-hui-gauge-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-glance-card.ts b/gallery/src/demos/demo-hui-glance-card.ts index 8da21ddbf59e..685133a0076a 100644 --- a/gallery/src/demos/demo-hui-glance-card.ts +++ b/gallery/src/demos/demo-hui-glance-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-iframe-card.ts b/gallery/src/demos/demo-hui-iframe-card.ts index b99e2fee8155..a2d493476bdb 100644 --- a/gallery/src/demos/demo-hui-iframe-card.ts +++ b/gallery/src/demos/demo-hui-iframe-card.ts @@ -1,4 +1,4 @@ -import { html, LitElement, customElement, TemplateResult } from "lit-element"; +import { customElement, html, LitElement, TemplateResult } from "lit-element"; import "../components/demo-cards"; const CONFIGS = [ diff --git a/gallery/src/demos/demo-hui-light-card.ts b/gallery/src/demos/demo-hui-light-card.ts index 9847cb8ea399..71d12b4af841 100644 --- a/gallery/src/demos/demo-hui-light-card.ts +++ b/gallery/src/demos/demo-hui-light-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-map-card.ts b/gallery/src/demos/demo-hui-map-card.ts index fc2afef75284..2cc55f499d16 100644 --- a/gallery/src/demos/demo-hui-map-card.ts +++ b/gallery/src/demos/demo-hui-map-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-markdown-card.ts b/gallery/src/demos/demo-hui-markdown-card.ts index 8a26cb566b84..8321eff7d3e2 100644 --- a/gallery/src/demos/demo-hui-markdown-card.ts +++ b/gallery/src/demos/demo-hui-markdown-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-media-control-card.ts b/gallery/src/demos/demo-hui-media-control-card.ts index c43388b3ddea..55bbc0168c94 100644 --- a/gallery/src/demos/demo-hui-media-control-card.ts +++ b/gallery/src/demos/demo-hui-media-control-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-media-player-rows.ts b/gallery/src/demos/demo-hui-media-player-rows.ts index 1cf419d91fb9..9ffabfee9bbe 100644 --- a/gallery/src/demos/demo-hui-media-player-rows.ts +++ b/gallery/src/demos/demo-hui-media-player-rows.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, @@ -31,9 +31,9 @@ const CONFIGS = [ - entity: media_player.android_cast name: Screen casting - entity: media_player.image_display - name: Digital Picture Frame + name: Digital Picture Frame - entity: media_player.sonos_idle - name: Sonos Idle + name: Sonos Idle - entity: media_player.idle_browse_media name: Idle waiting for Browse Media - entity: media_player.theater_off @@ -43,7 +43,7 @@ const CONFIGS = [ - entity: media_player.theater_off_static name: Player Off (cannot be switched on) - entity: media_player.theater_on_static - name: Player On (cannot be switched off) + name: Player On (cannot be switched off) - entity: media_player.idle name: Player Idle - entity: media_player.playing diff --git a/gallery/src/demos/demo-hui-picture-elements-card.ts b/gallery/src/demos/demo-hui-picture-elements-card.ts index ccd5aebcceee..6e6ffd86a055 100644 --- a/gallery/src/demos/demo-hui-picture-elements-card.ts +++ b/gallery/src/demos/demo-hui-picture-elements-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-picture-entity-card.ts b/gallery/src/demos/demo-hui-picture-entity-card.ts index a277686e8a53..fd0c5fea94a0 100644 --- a/gallery/src/demos/demo-hui-picture-entity-card.ts +++ b/gallery/src/demos/demo-hui-picture-entity-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-picture-glance-card.ts b/gallery/src/demos/demo-hui-picture-glance-card.ts index f5d61326a47a..9ecafb7f5a75 100644 --- a/gallery/src/demos/demo-hui-picture-glance-card.ts +++ b/gallery/src/demos/demo-hui-picture-glance-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-plant-card.ts b/gallery/src/demos/demo-hui-plant-card.ts index 88f8d3bfb16a..a1d49afe5b9c 100644 --- a/gallery/src/demos/demo-hui-plant-card.ts +++ b/gallery/src/demos/demo-hui-plant-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-shopping-list-card.ts b/gallery/src/demos/demo-hui-shopping-list-card.ts index fa16c165391e..a17bd61f1200 100644 --- a/gallery/src/demos/demo-hui-shopping-list-card.ts +++ b/gallery/src/demos/demo-hui-shopping-list-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-stack-card.ts b/gallery/src/demos/demo-hui-stack-card.ts index b0c2d10a4c78..26f03c405173 100644 --- a/gallery/src/demos/demo-hui-stack-card.ts +++ b/gallery/src/demos/demo-hui-stack-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-hui-thermostat-card.ts b/gallery/src/demos/demo-hui-thermostat-card.ts index 1fc117dc00d6..30e08d3e297f 100644 --- a/gallery/src/demos/demo-hui-thermostat-card.ts +++ b/gallery/src/demos/demo-hui-thermostat-card.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, PropertyValues, query, TemplateResult, diff --git a/gallery/src/demos/demo-more-info-light.ts b/gallery/src/demos/demo-more-info-light.ts index 46fe969412ec..3a05f1becfde 100644 --- a/gallery/src/demos/demo-more-info-light.ts +++ b/gallery/src/demos/demo-more-info-light.ts @@ -1,7 +1,7 @@ import { + customElement, html, LitElement, - customElement, property, PropertyValues, query, @@ -10,20 +10,20 @@ import { import "../../../src/components/ha-card"; import { SUPPORT_BRIGHTNESS, + SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_EFFECT, SUPPORT_FLASH, - SUPPORT_COLOR, SUPPORT_TRANSITION, SUPPORT_WHITE_VALUE, } from "../../../src/data/light"; +import "../../../src/dialogs/more-info/more-info-content"; import { getEntity } from "../../../src/fake_data/entity"; import { - provideHass, MockHomeAssistant, + provideHass, } from "../../../src/fake_data/provide_hass"; import "../components/demo-more-infos"; -import "../../../src/dialogs/more-info/more-info-content"; const ENTITIES = [ getEntity("light", "bed_light", "on", { diff --git a/hassio/src/addon-view/config/hassio-addon-audio.ts b/hassio/src/addon-view/config/hassio-addon-audio.ts index 71ef1170d5e4..e3349b014483 100644 --- a/hassio/src/addon-view/config/hassio-addon-audio.ts +++ b/hassio/src/addon-view/config/hassio-addon-audio.ts @@ -7,13 +7,14 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import "web-animations-js/web-animations-next-lite.min"; +import "../../../../src/components/buttons/ha-progress-button"; import "../../../../src/components/ha-card"; import { HassioAddonDetails, @@ -28,7 +29,6 @@ import { haStyle } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; import { suggestAddonRestart } from "../../dialogs/suggestAddonRestart"; import { hassioStyle } from "../../resources/hassio-style"; -import "../../../../src/components/buttons/ha-progress-button"; @customElement("hassio-addon-audio") class HassioAddonAudio extends LitElement { diff --git a/hassio/src/addon-view/config/hassio-addon-config-tab.ts b/hassio/src/addon-view/config/hassio-addon-config-tab.ts index 29e3f1778e46..c2af5ac92134 100644 --- a/hassio/src/addon-view/config/hassio-addon-config-tab.ts +++ b/hassio/src/addon-view/config/hassio-addon-config-tab.ts @@ -7,11 +7,11 @@ import { property, TemplateResult, } from "lit-element"; +import "../../../../src/components/ha-circular-progress"; import { HassioAddonDetails } from "../../../../src/data/hassio/addon"; import { haStyle } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; import { hassioStyle } from "../../resources/hassio-style"; -import "../../../../src/components/ha-circular-progress"; import "./hassio-addon-audio"; import "./hassio-addon-config"; import "./hassio-addon-network"; diff --git a/hassio/src/addon-view/hassio-addon-dashboard.ts b/hassio/src/addon-view/hassio-addon-dashboard.ts index 9876486d5f14..bee5d12166db 100644 --- a/hassio/src/addon-view/hassio-addon-dashboard.ts +++ b/hassio/src/addon-view/hassio-addon-dashboard.ts @@ -14,12 +14,12 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; +import "../../../src/components/ha-circular-progress"; import { fetchHassioAddonInfo, HassioAddonDetails, } from "../../../src/data/hassio/addon"; import "../../../src/layouts/hass-tabs-subpage"; -import "../../../src/components/ha-circular-progress"; import type { PageNavigation } from "../../../src/layouts/hass-tabs-subpage"; import { haStyle } from "../../../src/resources/styles"; import { HomeAssistant, Route } from "../../../src/types"; diff --git a/hassio/src/addon-view/info/hassio-addon-info-tab.ts b/hassio/src/addon-view/info/hassio-addon-info-tab.ts index a2c8fc378bb8..620ea89f5122 100644 --- a/hassio/src/addon-view/info/hassio-addon-info-tab.ts +++ b/hassio/src/addon-view/info/hassio-addon-info-tab.ts @@ -7,8 +7,8 @@ import { property, TemplateResult, } from "lit-element"; -import { HassioAddonDetails } from "../../../../src/data/hassio/addon"; import "../../../../src/components/ha-circular-progress"; +import { HassioAddonDetails } from "../../../../src/data/hassio/addon"; import { haStyle } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; import { hassioStyle } from "../../resources/hassio-style"; diff --git a/hassio/src/addon-view/log/hassio-addon-log-tab.ts b/hassio/src/addon-view/log/hassio-addon-log-tab.ts index 8961e61dd983..54bace246b7d 100644 --- a/hassio/src/addon-view/log/hassio-addon-log-tab.ts +++ b/hassio/src/addon-view/log/hassio-addon-log-tab.ts @@ -7,8 +7,8 @@ import { property, TemplateResult, } from "lit-element"; -import { HassioAddonDetails } from "../../../../src/data/hassio/addon"; import "../../../../src/components/ha-circular-progress"; +import { HassioAddonDetails } from "../../../../src/data/hassio/addon"; import { haStyle } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; import { hassioStyle } from "../../resources/hassio-style"; diff --git a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts index 6b36d31e5cc4..95177a18f524 100644 --- a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts +++ b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../src/components/ha-dialog"; diff --git a/hassio/src/entrypoint.ts b/hassio/src/entrypoint.ts index 00c34787e603..46f4722f9cae 100644 --- a/hassio/src/entrypoint.ts +++ b/hassio/src/entrypoint.ts @@ -1,6 +1,6 @@ import "../../src/resources/compatibility"; -import "../../src/resources/safari-14-attachshadow-patch"; import "../../src/resources/roboto"; +import "../../src/resources/safari-14-attachshadow-patch"; import "./hassio-main"; const styleEl = document.createElement("style"); diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts index 2ee909885e05..81d736e881b7 100644 --- a/hassio/src/hassio-main.ts +++ b/hassio/src/hassio-main.ts @@ -1,11 +1,11 @@ -import { html, PropertyValues, customElement, property } from "lit-element"; -import "./hassio-router"; -import { HomeAssistant, Route } from "../../src/types"; -import { HassioPanelInfo } from "../../src/data/hassio/supervisor"; +import { customElement, html, property, PropertyValues } from "lit-element"; +import { atLeastVersion } from "../../src/common/config/version"; import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element"; import { fireEvent } from "../../src/common/dom/fire_event"; +import { HassioPanelInfo } from "../../src/data/hassio/supervisor"; import { makeDialogManager } from "../../src/dialogs/make-dialog-manager"; -import { atLeastVersion } from "../../src/common/config/version"; +import { HomeAssistant, Route } from "../../src/types"; +import "./hassio-router"; import { SupervisorBaseElement } from "./supervisor-base-element"; @customElement("hassio-main") diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index 14962c6f36c4..531673ac2f32 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -1,14 +1,17 @@ +import { mdiMenu } from "@mdi/js"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; +import { fireEvent } from "../../../src/common/dom/fire_event"; +import { navigate } from "../../../src/common/navigate"; import { fetchHassioAddonInfo, HassioAddonDetails, @@ -17,13 +20,10 @@ import { createHassioSession, validateHassioSession, } from "../../../src/data/hassio/ingress"; +import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box"; import "../../../src/layouts/hass-loading-screen"; import "../../../src/layouts/hass-subpage"; import { HomeAssistant, Route } from "../../../src/types"; -import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box"; -import { navigate } from "../../../src/common/navigate"; -import { mdiMenu } from "@mdi/js"; -import { fireEvent } from "../../../src/common/dom/fire_event"; @customElement("hassio-ingress-view") class HassioIngressView extends LitElement { diff --git a/src/auth/ha-auth-flow.ts b/src/auth/ha-auth-flow.ts index a4234c56ca6d..a4092f0e41f5 100644 --- a/src/auth/ha-auth-flow.ts +++ b/src/auth/ha-auth-flow.ts @@ -3,9 +3,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index 0d5cdd4181d4..3841a9ec1d22 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -2,21 +2,21 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, } from "lit-element"; +import punycode from "punycode"; +import { extractSearchParamsObject } from "../common/url/search-params"; import { AuthProvider, - fetchAuthProviders, AuthUrlSearchParams, + fetchAuthProviders, } from "../data/auth"; import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin"; import { registerServiceWorker } from "../util/register-service-worker"; import "./ha-auth-flow"; -import { extractSearchParamsObject } from "../common/url/search-params"; -import punycode from "punycode"; import("./ha-pick-auth-provider"); diff --git a/src/common/config/can_show_page.ts b/src/common/config/can_show_page.ts index 0ac4f6d2ecd8..05e96d43e232 100644 --- a/src/common/config/can_show_page.ts +++ b/src/common/config/can_show_page.ts @@ -1,6 +1,6 @@ -import { isComponentLoaded } from "./is_component_loaded"; import { PageNavigation } from "../../layouts/hass-tabs-subpage"; import { HomeAssistant } from "../../types"; +import { isComponentLoaded } from "./is_component_loaded"; export const canShowPage = (hass: HomeAssistant, page: PageNavigation) => { return ( diff --git a/src/common/entity/compute_state_display.ts b/src/common/entity/compute_state_display.ts index f946d34015d5..aa6cf3f19c2f 100644 --- a/src/common/entity/compute_state_display.ts +++ b/src/common/entity/compute_state_display.ts @@ -3,9 +3,9 @@ import { UNAVAILABLE, UNKNOWN } from "../../data/entity"; import { formatDate } from "../datetime/format_date"; import { formatDateTime } from "../datetime/format_date_time"; import { formatTime } from "../datetime/format_time"; +import { formatNumber } from "../string/format_number"; import { LocalizeFunc } from "../translations/localize"; import { computeStateDomain } from "./compute_state_domain"; -import { formatNumber } from "../string/format_number"; export const computeStateDisplay = ( localize: LocalizeFunc, diff --git a/src/common/entity/state_card_type.ts b/src/common/entity/state_card_type.ts index 2013ee2058e3..a1f2aa561e2d 100644 --- a/src/common/entity/state_card_type.ts +++ b/src/common/entity/state_card_type.ts @@ -1,9 +1,9 @@ import { HassEntity } from "home-assistant-js-websocket"; +import { UNAVAILABLE } from "../../data/entity"; import { HomeAssistant } from "../../types"; import { DOMAINS_WITH_CARD } from "../const"; import { canToggleState } from "./can_toggle_state"; import { computeStateDomain } from "./compute_state_domain"; -import { UNAVAILABLE } from "../../data/entity"; export const stateCardType = (hass: HomeAssistant, stateObj: HassEntity) => { if (stateObj.state === UNAVAILABLE) { diff --git a/src/common/image/extract_color.ts b/src/common/image/extract_color.ts index e9561bcc8c59..883695e57d08 100644 --- a/src/common/image/extract_color.ts +++ b/src/common/image/extract_color.ts @@ -1,7 +1,7 @@ -import Vibrant from "node-vibrant/lib/browser"; -import MMCQ from "@vibrant/quantizer-mmcq"; -import { BasicPipeline } from "@vibrant/core/lib/pipeline"; import { Swatch, Vec3 } from "@vibrant/color"; +import { BasicPipeline } from "@vibrant/core/lib/pipeline"; +import MMCQ from "@vibrant/quantizer-mmcq"; +import Vibrant from "node-vibrant/lib/browser"; import { getRGBContrastRatio } from "../color/rgb"; const CONTRAST_RATIO = 4.5; diff --git a/src/common/search/search-input.ts b/src/common/search/search-input.ts index 97a52b1864dc..aff3a1a2a7a9 100644 --- a/src/common/search/search-input.ts +++ b/src/common/search/search-input.ts @@ -1,3 +1,5 @@ +import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiClose, mdiMagnify } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import { css, @@ -10,8 +12,6 @@ import { html, TemplateResult } from "lit-html"; import { classMap } from "lit-html/directives/class-map"; import "../../components/ha-svg-icon"; import { fireEvent } from "../dom/fire_event"; -import { mdiMagnify, mdiClose } from "@mdi/js"; -import "@material/mwc-icon-button/mwc-icon-button"; @customElement("search-input") class SearchInput extends LitElement { diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index 47bbca76926f..94edcc8a7a06 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -1,5 +1,5 @@ -import IntlMessageFormat from "intl-messageformat"; import { shouldPolyfill } from "@formatjs/intl-pluralrules/should-polyfill"; +import IntlMessageFormat from "intl-messageformat"; import { Resources } from "../../types"; export type LocalizeFunc = (key: string, ...args: any[]) => string; diff --git a/src/components/buttons/ha-progress-button.ts b/src/components/buttons/ha-progress-button.ts index c6c325fdab4d..bb431cf7cbe7 100644 --- a/src/components/buttons/ha-progress-button.ts +++ b/src/components/buttons/ha-progress-button.ts @@ -7,10 +7,9 @@ import { html, LitElement, property, - TemplateResult, query, + TemplateResult, } from "lit-element"; - import "../ha-circular-progress"; @customElement("ha-progress-button") diff --git a/src/components/data-table/sort-filter.ts b/src/components/data-table/sort-filter.ts index 79a41e6d775f..6fcd8e522a78 100644 --- a/src/components/data-table/sort-filter.ts +++ b/src/components/data-table/sort-filter.ts @@ -1,5 +1,4 @@ import { wrap } from "comlink"; - import type { api } from "./sort_filter_worker"; type FilterDataType = api["filterData"]; diff --git a/src/components/date-range-picker.ts b/src/components/date-range-picker.ts index 70211da36603..f7ec87169e8f 100644 --- a/src/components/date-range-picker.ts +++ b/src/components/date-range-picker.ts @@ -1,11 +1,11 @@ // @ts-nocheck -import Vue from "vue"; import wrap from "@vue/web-component-wrapper"; +import { customElement } from "lit-element/lib/decorators"; +import Vue from "vue"; import DateRangePicker from "vue2-daterange-picker"; import dateRangePickerStyles from "vue2-daterange-picker/dist/vue2-daterange-picker.css"; import { fireEvent } from "../common/dom/fire_event"; import { Constructor } from "../types"; -import { customElement } from "lit-element/lib/decorators"; const Component = Vue.extend({ props: { @@ -210,7 +210,7 @@ class DateRangePickerElement extends WrappedElement { } .calendar-table { padding: 0 !important; - } + } `; const shadowRoot = this.shadowRoot!; shadowRoot.appendChild(style); diff --git a/src/components/device/ha-area-devices-picker.ts b/src/components/device/ha-area-devices-picker.ts index ed3d5c25f3fe..6e635d0720e9 100644 --- a/src/components/device/ha-area-devices-picker.ts +++ b/src/components/device/ha-area-devices-picker.ts @@ -1,5 +1,6 @@ -import "@material/mwc-icon-button/mwc-icon-button"; import "@material/mwc-button/mwc-button"; +import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -11,9 +12,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,9 +38,8 @@ import { import { SubscribeMixin } from "../../mixins/subscribe-mixin"; import { PolymerChangedEvent } from "../../polymer-types"; import { HomeAssistant } from "../../types"; -import "./ha-devices-picker"; import "../ha-svg-icon"; -import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; +import "./ha-devices-picker"; interface DevicesByArea { [areaId: string]: AreaDevices; diff --git a/src/components/device/ha-device-automation-picker.ts b/src/components/device/ha-device-automation-picker.ts index fe56884a09fb..dba3b7b224f6 100644 --- a/src/components/device/ha-device-automation-picker.ts +++ b/src/components/device/ha-device-automation-picker.ts @@ -6,9 +6,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; diff --git a/src/components/device/ha-device-picker.ts b/src/components/device/ha-device-picker.ts index c1e86dd761eb..0139a08c423b 100644 --- a/src/components/device/ha-device-picker.ts +++ b/src/components/device/ha-device-picker.ts @@ -1,5 +1,5 @@ -import "../ha-svg-icon"; import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -38,7 +38,7 @@ import { import { SubscribeMixin } from "../../mixins/subscribe-mixin"; import { PolymerChangedEvent } from "../../polymer-types"; import { HomeAssistant } from "../../types"; -import { mdiClose, mdiMenuUp, mdiMenuDown } from "@mdi/js"; +import "../ha-svg-icon"; interface Device { name: string; diff --git a/src/components/entity/ha-battery-icon.ts b/src/components/entity/ha-battery-icon.ts index 1838f6af5e1e..45f4f7d55330 100644 --- a/src/components/entity/ha-battery-icon.ts +++ b/src/components/entity/ha-battery-icon.ts @@ -1,6 +1,6 @@ +import { customElement, html, LitElement, property } from "lit-element"; import { batteryIcon } from "../../common/entity/battery_icon"; import "../ha-icon"; -import { customElement, html, property, LitElement } from "lit-element"; @customElement("ha-battery-icon") export class HaBatteryIcon extends LitElement { diff --git a/src/components/entity/ha-entity-attribute-picker.ts b/src/components/entity/ha-entity-attribute-picker.ts index 5b1dbfc08066..784ea421f843 100644 --- a/src/components/entity/ha-entity-attribute-picker.ts +++ b/src/components/entity/ha-entity-attribute-picker.ts @@ -1,3 +1,4 @@ +import "@material/mwc-icon-button/mwc-icon-button"; import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; @@ -17,10 +18,9 @@ import { import { fireEvent } from "../../common/dom/fire_event"; import { PolymerChangedEvent } from "../../polymer-types"; import { HomeAssistant } from "../../types"; +import { formatAttributeName } from "../../util/hass-attributes-util"; import "../ha-svg-icon"; import "./state-badge"; -import { formatAttributeName } from "../../util/hass-attributes-util"; -import "@material/mwc-icon-button/mwc-icon-button"; export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean; diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index ca46ad32b05a..93bd745e87c1 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -1,21 +1,21 @@ -import "../ha-icon-button"; import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { STATES_OFF } from "../../common/const"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; -import { UNAVAILABLE_STATES, UNAVAILABLE } from "../../data/entity"; +import { UNAVAILABLE, UNAVAILABLE_STATES } from "../../data/entity"; import { forwardHaptic } from "../../data/haptics"; import { HomeAssistant } from "../../types"; +import "../ha-icon-button"; import "../ha-switch"; const isOn = (stateObj?: HassEntity) => diff --git a/src/components/entity/ha-state-label-badge.ts b/src/components/entity/ha-state-label-badge.ts index 11a4761a2c70..86e4d899b1ef 100644 --- a/src/components/entity/ha-state-label-badge.ts +++ b/src/components/entity/ha-state-label-badge.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -18,10 +18,10 @@ import { computeStateName } from "../../common/entity/compute_state_name"; import { domainIcon } from "../../common/entity/domain_icon"; import { stateIcon } from "../../common/entity/state_icon"; import { timerTimeRemaining } from "../../common/entity/timer_time_remaining"; +import { formatNumber } from "../../common/string/format_number"; +import { UNAVAILABLE, UNKNOWN } from "../../data/entity"; import { HomeAssistant } from "../../types"; import "../ha-label-badge"; -import { UNAVAILABLE, UNKNOWN } from "../../data/entity"; -import { formatNumber } from "../../common/string/format_number"; @customElement("ha-state-label-badge") export class HaStateLabelBadge extends LitElement { diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index 200b125e90b1..737134271ec9 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -11,14 +11,11 @@ import { } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; import { styleMap } from "lit-html/directives/style-map"; - import { computeActiveState } from "../../common/entity/compute_active_state"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { stateIcon } from "../../common/entity/state_icon"; import { iconColorCSS } from "../../common/style/icon_color_css"; - import type { HomeAssistant } from "../../types"; - import "../ha-icon"; export class StateBadge extends LitElement { diff --git a/src/components/entity/state-info.ts b/src/components/entity/state-info.ts index e4d132ab8488..a56f36638f75 100644 --- a/src/components/entity/state-info.ts +++ b/src/components/entity/state-info.ts @@ -1,4 +1,5 @@ import "@polymer/paper-tooltip/paper-tooltip"; +import type { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -8,12 +9,9 @@ import { property, TemplateResult, } from "lit-element"; -import type { HassEntity } from "home-assistant-js-websocket"; - import { computeStateName } from "../../common/entity/compute_state_name"; import { computeRTL } from "../../common/util/compute_rtl"; import type { HomeAssistant } from "../../types"; - import "../ha-relative-time"; import "./state-badge"; diff --git a/src/components/ha-area-picker.ts b/src/components/ha-area-picker.ts index 9ad7391448e5..c6b263fd54ed 100644 --- a/src/components/ha-area-picker.ts +++ b/src/components/ha-area-picker.ts @@ -1,5 +1,5 @@ -import "./ha-svg-icon"; import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -11,27 +11,21 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, PropertyValues, query, + TemplateResult, } from "lit-element"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; +import { computeDomain } from "../common/entity/compute_domain"; import { AreaRegistryEntry, createAreaRegistryEntry, subscribeAreaRegistry, } from "../data/area_registry"; -import { - showAlertDialog, - showPromptDialog, -} from "../dialogs/generic/show-dialog-box"; -import { SubscribeMixin } from "../mixins/subscribe-mixin"; -import { PolymerChangedEvent } from "../polymer-types"; -import { HomeAssistant } from "../types"; -import memoizeOne from "memoize-one"; import { DeviceEntityLookup, DeviceRegistryEntry, @@ -41,9 +35,15 @@ import { EntityRegistryEntry, subscribeEntityRegistry, } from "../data/entity_registry"; -import { computeDomain } from "../common/entity/compute_domain"; +import { + showAlertDialog, + showPromptDialog, +} from "../dialogs/generic/show-dialog-box"; +import { SubscribeMixin } from "../mixins/subscribe-mixin"; +import { PolymerChangedEvent } from "../polymer-types"; +import { HomeAssistant } from "../types"; import type { HaDevicePickerDeviceFilterFunc } from "./device/ha-device-picker"; -import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; +import "./ha-svg-icon"; const rowRenderer = ( root: HTMLElement, diff --git a/src/components/ha-bar.ts b/src/components/ha-bar.ts index 6d449c3306f0..3378958a569a 100644 --- a/src/components/ha-bar.ts +++ b/src/components/ha-bar.ts @@ -7,7 +7,6 @@ import { svg, TemplateResult, } from "lit-element"; - import { getValueInPercentage, normalize, diff --git a/src/components/ha-button-toggle-group.ts b/src/components/ha-button-toggle-group.ts index f932cb4357df..33c65cdf82c5 100644 --- a/src/components/ha-button-toggle-group.ts +++ b/src/components/ha-button-toggle-group.ts @@ -1,3 +1,4 @@ +import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; import { css, @@ -11,7 +12,6 @@ import { import { fireEvent } from "../common/dom/fire_event"; import type { ToggleButton } from "../types"; import "./ha-svg-icon"; -import "@material/mwc-button/mwc-button"; @customElement("ha-button-toggle-group") export class HaButtonToggleGroup extends LitElement { diff --git a/src/components/ha-circular-progress.ts b/src/components/ha-circular-progress.ts index c3e188d267bd..7b69afa6b82e 100644 --- a/src/components/ha-circular-progress.ts +++ b/src/components/ha-circular-progress.ts @@ -1,5 +1,5 @@ -import { customElement, property } from "lit-element"; import { CircularProgress } from "@material/mwc-circular-progress"; +import { customElement, property } from "lit-element"; @customElement("ha-circular-progress") // @ts-ignore diff --git a/src/components/ha-climate-control.js b/src/components/ha-climate-control.js index f4732d8623fd..9962680dfd8f 100644 --- a/src/components/ha-climate-control.js +++ b/src/components/ha-climate-control.js @@ -1,9 +1,9 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes"; -import "./ha-icon-button"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { EventsMixin } from "../mixins/events-mixin"; +import "./ha-icon-button"; /* * @appliesMixin EventsMixin diff --git a/src/components/ha-climate-state.ts b/src/components/ha-climate-state.ts index ba5e5844ecb7..9b46f6cdb832 100644 --- a/src/components/ha-climate-state.ts +++ b/src/components/ha-climate-state.ts @@ -1,3 +1,4 @@ +import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -7,11 +8,9 @@ import { property, TemplateResult, } from "lit-element"; -import { HassEntity } from "home-assistant-js-websocket"; - +import { formatNumber } from "../common/string/format_number"; import { CLIMATE_PRESET_NONE } from "../data/climate"; import type { HomeAssistant } from "../types"; -import { formatNumber } from "../common/string/format_number"; @customElement("ha-climate-state") class HaClimateState extends LitElement { diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index 5dc3b7f82641..50e851fd22e8 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -131,81 +131,81 @@ export class HaCodeEditor extends UpdatingElement { .cm-s-default .CodeMirror-cursor { border-left: 1px solid var(--secondary-text-color); } - + .cm-s-default div.CodeMirror-selected, .cm-s-default.CodeMirror-focused div.CodeMirror-selected { background: rgba(var(--rgb-primary-color), 0.2); } - + .cm-s-default .CodeMirror-line::selection, .cm-s-default .CodeMirror-line>span::selection, .cm-s-default .CodeMirror-line>span>span::selection { background: rgba(var(--rgb-primary-color), 0.2); } - + .cm-s-default .cm-keyword { color: var(--codemirror-keyword, #6262FF); } - + .cm-s-default .cm-operator { color: var(--codemirror-operator, #cda869); } - + .cm-s-default .cm-variable-2 { color: var(--codemirror-variable-2, #690); } - + .cm-s-default .cm-builtin { color: var(--codemirror-builtin, #9B7536); } - + .cm-s-default .cm-atom { color: var(--codemirror-atom, #F90); } - + .cm-s-default .cm-number { color: var(--codemirror-number, #ca7841); } - + .cm-s-default .cm-def { color: var(--codemirror-def, #8DA6CE); } - + .cm-s-default .cm-string { color: var(--codemirror-string, #07a); } - + .cm-s-default .cm-string-2 { color: var(--codemirror-string-2, #bd6b18); } - + .cm-s-default .cm-comment { color: var(--codemirror-comment, #777); } - + .cm-s-default .cm-variable { color: var(--codemirror-variable, #07a); } - + .cm-s-default .cm-tag { color: var(--codemirror-tag, #997643); } - + .cm-s-default .cm-meta { color: var(--codemirror-meta, var(--primary-text-color)); } - + .cm-s-default .cm-attribute { color: var(--codemirror-attribute, #d6bb6d); } - + .cm-s-default .cm-property { color: var(--codemirror-property, #905); } - + .cm-s-default .cm-qualifier { color: var(--codemirror-qualifier, #690); } - + .cm-s-default .cm-variable-3 { color: var(--codemirror-variable-3, #07a); } diff --git a/src/components/ha-combo-box.js b/src/components/ha-combo-box.js index 62d66b4511ee..b844d2749650 100644 --- a/src/components/ha-combo-box.js +++ b/src/components/ha-combo-box.js @@ -1,4 +1,3 @@ -import "./ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import { html } from "@polymer/polymer/lib/utils/html-tag"; @@ -6,6 +5,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { EventsMixin } from "../mixins/events-mixin"; +import "./ha-icon-button"; class HaComboBox extends EventsMixin(PolymerElement) { static get template() { diff --git a/src/components/ha-cover-controls.ts b/src/components/ha-cover-controls.ts index 06def92e2399..08910a7735c4 100644 --- a/src/components/ha-cover-controls.ts +++ b/src/components/ha-cover-controls.ts @@ -1,3 +1,4 @@ +import type { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -10,14 +11,11 @@ import { TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; -import type { HassEntity } from "home-assistant-js-websocket"; - -import type { HomeAssistant } from "../types"; +import { computeCloseIcon, computeOpenIcon } from "../common/entity/cover_icon"; import { UNAVAILABLE } from "../data/entity"; +import type { HomeAssistant } from "../types"; import CoverEntity from "../util/cover-model"; - import "./ha-icon-button"; -import { computeCloseIcon, computeOpenIcon } from "../common/entity/cover_icon"; @customElement("ha-cover-controls") class HaCoverControls extends LitElement { diff --git a/src/components/ha-cover-tilt-controls.ts b/src/components/ha-cover-tilt-controls.ts index 790721f11a97..893745a79855 100644 --- a/src/components/ha-cover-tilt-controls.ts +++ b/src/components/ha-cover-tilt-controls.ts @@ -1,21 +1,19 @@ import { HassEntity } from "home-assistant-js-websocket"; import { - LitElement, - property, - internalProperty, - CSSResult, css, + CSSResult, customElement, - TemplateResult, html, + internalProperty, + LitElement, + property, PropertyValues, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; - import { UNAVAILABLE } from "../data/entity"; import { HomeAssistant } from "../types"; import CoverEntity from "../util/cover-model"; - import "./ha-icon-button"; @customElement("ha-cover-tilt-controls") diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index 895a33f984fc..91db9cab2308 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -1,3 +1,9 @@ +import "@material/mwc-button/mwc-button"; +import "@material/mwc-list/mwc-list"; +import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import "@material/mwc-list/mwc-list-item"; +import { mdiCalendar } from "@mdi/js"; +import "@polymer/paper-input/paper-input"; import { css, CSSResult, @@ -5,20 +11,14 @@ import { html, LitElement, property, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; -import { HomeAssistant } from "../types"; -import { mdiCalendar } from "@mdi/js"; import { formatDateTime } from "../common/datetime/format_date_time"; -import "@material/mwc-button/mwc-button"; -import "@material/mwc-list/mwc-list-item"; -import "./ha-svg-icon"; -import "@polymer/paper-input/paper-input"; -import "@material/mwc-list/mwc-list"; -import "./date-range-picker"; import { computeRTLDirection } from "../common/util/compute_rtl"; -import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import { HomeAssistant } from "../types"; +import "./date-range-picker"; +import "./ha-svg-icon"; export interface DateRangePickerRanges { [key: string]: [Date, Date]; diff --git a/src/components/ha-expansion-panel.ts b/src/components/ha-expansion-panel.ts index f328e3590eb4..83eac261d0a3 100644 --- a/src/components/ha-expansion-panel.ts +++ b/src/components/ha-expansion-panel.ts @@ -1,3 +1,4 @@ +import { mdiChevronDown } from "@mdi/js"; import { css, CSSResult, @@ -8,10 +9,9 @@ import { query, TemplateResult, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import { fireEvent } from "../common/dom/fire_event"; import "./ha-svg-icon"; -import { mdiChevronDown } from "@mdi/js"; -import { classMap } from "lit-html/directives/class-map"; @customElement("ha-expansion-panel") class HaExpansionPanel extends LitElement { diff --git a/src/components/ha-fab.ts b/src/components/ha-fab.ts index f0917173a04e..9725630b6cea 100644 --- a/src/components/ha-fab.ts +++ b/src/components/ha-fab.ts @@ -1,5 +1,5 @@ -import type { Fab } from "@material/mwc-fab"; import "@material/mwc-fab"; +import type { Fab } from "@material/mwc-fab"; import { customElement } from "lit-element"; import { Constructor } from "../types"; diff --git a/src/components/ha-form/ha-form-constant.ts b/src/components/ha-form/ha-form-constant.ts index 9ce3a0243787..4e6d6e21b414 100644 --- a/src/components/ha-form/ha-form-constant.ts +++ b/src/components/ha-form/ha-form-constant.ts @@ -1,15 +1,15 @@ import { + css, + CSSResult, customElement, html, LitElement, property, - TemplateResult, - CSSResult, - css, PropertyValues, + TemplateResult, } from "lit-element"; -import { HaFormElement, HaFormConstantSchema } from "./ha-form"; import { fireEvent } from "../../common/dom/fire_event"; +import { HaFormConstantSchema, HaFormElement } from "./ha-form"; @customElement("ha-form-constant") export class HaFormConstant extends LitElement implements HaFormElement { diff --git a/src/components/ha-form/ha-form-multi_select.ts b/src/components/ha-form/ha-form-multi_select.ts index 29f174a16047..290c1a17b097 100644 --- a/src/components/ha-form/ha-form-multi_select.ts +++ b/src/components/ha-form/ha-form-multi_select.ts @@ -9,19 +9,19 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; +import "../ha-icon"; import { HaFormElement, HaFormMultiSelectData, HaFormMultiSelectSchema, } from "./ha-form"; -import "../ha-icon"; @customElement("ha-form-multi_select") export class HaFormMultiSelect extends LitElement implements HaFormElement { diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index 3f62f9de3152..5775051dced8 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -1,16 +1,16 @@ -import "../ha-icon-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; +import "../ha-icon-button"; import type { HaFormElement, HaFormStringData, diff --git a/src/components/ha-form/ha-form.ts b/src/components/ha-form/ha-form.ts index 87af77520255..bab97d6a2224 100644 --- a/src/components/ha-form/ha-form.ts +++ b/src/components/ha-form/ha-form.ts @@ -9,13 +9,13 @@ import { import { dynamicElement } from "../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../common/dom/fire_event"; import "./ha-form-boolean"; +import "./ha-form-constant"; import "./ha-form-float"; import "./ha-form-integer"; import "./ha-form-multi_select"; import "./ha-form-positive_time_period_dict"; import "./ha-form-select"; import "./ha-form-string"; -import "./ha-form-constant"; export type HaFormSchema = | HaFormConstantSchema diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 249a5639a529..692189c24338 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -1,18 +1,17 @@ import { - LitElement, - svg, - customElement, css, - property, + customElement, internalProperty, + LitElement, + property, PropertyValues, + svg, } from "lit-element"; +import { ifDefined } from "lit-html/directives/if-defined"; import { styleMap } from "lit-html/directives/style-map"; +import { formatNumber } from "../common/string/format_number"; import { afterNextRender } from "../common/util/render-status"; -import { ifDefined } from "lit-html/directives/if-defined"; - import { getValueInPercentage, normalize } from "../util/calculate"; -import { formatNumber } from "../common/string/format_number"; const getAngle = (value: number, min: number, max: number) => { const percentage = getValueInPercentage(normalize(value, min, max), min, max); diff --git a/src/components/ha-icon-button-arrow-next.ts b/src/components/ha-icon-button-arrow-next.ts index fa2917db6a67..85bc2d245fe0 100644 --- a/src/components/ha-icon-button-arrow-next.ts +++ b/src/components/ha-icon-button-arrow-next.ts @@ -1,15 +1,15 @@ +import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; import { + customElement, + html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, - html, - customElement, } from "lit-element"; -import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; -import "@material/mwc-icon-button/mwc-icon-button"; -import "./ha-svg-icon"; import { HomeAssistant } from "../types"; +import "./ha-svg-icon"; @customElement("ha-icon-button-arrow-next") export class HaIconButtonArrowNext extends LitElement { diff --git a/src/components/ha-icon-button-arrow-prev.ts b/src/components/ha-icon-button-arrow-prev.ts index c7fbada10d6b..c426c589a712 100644 --- a/src/components/ha-icon-button-arrow-prev.ts +++ b/src/components/ha-icon-button-arrow-prev.ts @@ -1,15 +1,15 @@ +import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; import { + customElement, + html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, - html, - customElement, } from "lit-element"; -import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; -import "@material/mwc-icon-button/mwc-icon-button"; -import "./ha-svg-icon"; import { HomeAssistant } from "../types"; +import "./ha-svg-icon"; @customElement("ha-icon-button-arrow-prev") export class HaIconButtonArrowPrev extends LitElement { diff --git a/src/components/ha-icon-button-next.ts b/src/components/ha-icon-button-next.ts index 48eca31a4aa5..04213393ebb7 100644 --- a/src/components/ha-icon-button-next.ts +++ b/src/components/ha-icon-button-next.ts @@ -1,15 +1,15 @@ +import "@material/mwc-icon-button"; +import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { + customElement, + html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, - html, - customElement, } from "lit-element"; -import { mdiChevronRight, mdiChevronLeft } from "@mdi/js"; -import "@material/mwc-icon-button"; -import "./ha-svg-icon"; import { HomeAssistant } from "../types"; +import "./ha-svg-icon"; @customElement("ha-icon-button-next") export class HaIconButtonNext extends LitElement { diff --git a/src/components/ha-icon-button-prev.ts b/src/components/ha-icon-button-prev.ts index 8b88afedda90..6384039f13cf 100644 --- a/src/components/ha-icon-button-prev.ts +++ b/src/components/ha-icon-button-prev.ts @@ -1,15 +1,15 @@ +import "@material/mwc-icon-button/mwc-icon-button"; +import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { + customElement, + html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, - html, - customElement, } from "lit-element"; -import { mdiChevronRight, mdiChevronLeft } from "@mdi/js"; -import "@material/mwc-icon-button/mwc-icon-button"; -import "./ha-svg-icon"; import { HomeAssistant } from "../types"; +import "./ha-svg-icon"; @customElement("ha-icon-button-prev") export class HaIconButtonPrev extends LitElement { diff --git a/src/components/ha-icon-button.ts b/src/components/ha-icon-button.ts index 1c645b50cdb1..e8cc62ab5585 100644 --- a/src/components/ha-icon-button.ts +++ b/src/components/ha-icon-button.ts @@ -1,12 +1,12 @@ import "@material/mwc-icon-button"; import { + css, + CSSResult, customElement, html, - TemplateResult, - property, LitElement, - CSSResult, - css, + property, + TemplateResult, } from "lit-element"; import "./ha-icon"; diff --git a/src/components/ha-icon-next.ts b/src/components/ha-icon-next.ts index 742f342e919f..6b6eef9b012c 100644 --- a/src/components/ha-icon-next.ts +++ b/src/components/ha-icon-next.ts @@ -1,5 +1,5 @@ +import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { HaSvgIcon } from "./ha-svg-icon"; -import { mdiChevronRight, mdiChevronLeft } from "@mdi/js"; export class HaIconNext extends HaSvgIcon { public connectedCallback() { diff --git a/src/components/ha-icon-prev.ts b/src/components/ha-icon-prev.ts index df800fd52d87..29712fc89bdc 100644 --- a/src/components/ha-icon-prev.ts +++ b/src/components/ha-icon-prev.ts @@ -1,5 +1,5 @@ +import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { HaSvgIcon } from "./ha-svg-icon"; -import { mdiChevronRight, mdiChevronLeft } from "@mdi/js"; export class HaIconPrev extends HaSvgIcon { public connectedCallback() { diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index 8fe065bc6ec4..2cb7e0bdf6cd 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -1,28 +1,28 @@ import "@polymer/iron-icon/iron-icon"; import { + css, + CSSResult, customElement, + html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, - html, TemplateResult, - css, - CSSResult, } from "lit-element"; -import "./ha-svg-icon"; -import { customIconsets, CustomIcon } from "../data/custom_iconsets"; +import { fireEvent } from "../common/dom/fire_event"; +import { debounce } from "../common/util/debounce"; +import { CustomIcon, customIconsets } from "../data/custom_iconsets"; import { + checkCacheVersion, Chunks, - MDI_PREFIXES, - getIcon, findIconChunk, + getIcon, Icons, - checkCacheVersion, + MDI_PREFIXES, writeCache, } from "../data/iconsets"; -import { debounce } from "../common/util/debounce"; -import { fireEvent } from "../common/dom/fire_event"; +import "./ha-svg-icon"; interface DeprecatedIcon { [key: string]: { diff --git a/src/components/ha-markdown.ts b/src/components/ha-markdown.ts index 484776a2b086..c98f5d07a966 100644 --- a/src/components/ha-markdown.ts +++ b/src/components/ha-markdown.ts @@ -7,7 +7,6 @@ import { property, TemplateResult, } from "lit-element"; - import "./ha-markdown-element"; @customElement("ha-markdown") diff --git a/src/components/ha-push-notifications-toggle.js b/src/components/ha-push-notifications-toggle.js index b8bead07fc96..dfb876b9a750 100644 --- a/src/components/ha-push-notifications-toggle.js +++ b/src/components/ha-push-notifications-toggle.js @@ -2,8 +2,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { getAppKey } from "../data/notify_html5"; -import { EventsMixin } from "../mixins/events-mixin"; import { showPromptDialog } from "../dialogs/generic/show-dialog-box"; +import { EventsMixin } from "../mixins/events-mixin"; import "./ha-switch"; export const pushSupported = diff --git a/src/components/ha-related-items.ts b/src/components/ha-related-items.ts index 4bdcdda1e941..3d2cc72c27d4 100644 --- a/src/components/ha-related-items.ts +++ b/src/components/ha-related-items.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/components/ha-relative-time.ts b/src/components/ha-relative-time.ts index a2f9e403ca27..98b9228dec72 100644 --- a/src/components/ha-relative-time.ts +++ b/src/components/ha-relative-time.ts @@ -1,12 +1,10 @@ import { customElement, - UpdatingElement, property, PropertyValues, + UpdatingElement, } from "lit-element"; - import relativeTime from "../common/datetime/relative_time"; - import type { HomeAssistant } from "../types"; @customElement("ha-relative-time") diff --git a/src/components/ha-selector/ha-selector-action.ts b/src/components/ha-selector/ha-selector-action.ts index c6e06e3a1267..be91204c7fe2 100644 --- a/src/components/ha-selector/ha-selector-action.ts +++ b/src/components/ha-selector/ha-selector-action.ts @@ -6,10 +6,10 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; -import { ActionSelector } from "../../data/selector"; import { Action } from "../../data/script"; +import { ActionSelector } from "../../data/selector"; import "../../panels/config/automation/action/ha-automation-action"; +import { HomeAssistant } from "../../types"; @customElement("ha-selector-action") export class HaActionSelector extends LitElement { diff --git a/src/components/ha-selector/ha-selector-area.ts b/src/components/ha-selector/ha-selector-area.ts index 903626440b1d..8023dc484433 100644 --- a/src/components/ha-selector/ha-selector-area.ts +++ b/src/components/ha-selector/ha-selector-area.ts @@ -5,12 +5,12 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; -import { AreaSelector } from "../../data/selector"; -import "../ha-area-picker"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { EntityRegistryEntry } from "../../data/entity_registry"; +import { AreaSelector } from "../../data/selector"; +import { HomeAssistant } from "../../types"; +import "../ha-area-picker"; @customElement("ha-selector-area") export class HaAreaSelector extends LitElement { diff --git a/src/components/ha-selector/ha-selector-device.ts b/src/components/ha-selector/ha-selector-device.ts index f3f2c1ff3557..d9ec80655c3a 100644 --- a/src/components/ha-selector/ha-selector-device.ts +++ b/src/components/ha-selector/ha-selector-device.ts @@ -5,11 +5,11 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; -import "../device/ha-device-picker"; -import { DeviceRegistryEntry } from "../../data/device_registry"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; +import { DeviceRegistryEntry } from "../../data/device_registry"; import { DeviceSelector } from "../../data/selector"; +import { HomeAssistant } from "../../types"; +import "../device/ha-device-picker"; @customElement("ha-selector-device") export class HaDeviceSelector extends LitElement { diff --git a/src/components/ha-selector/ha-selector-entity.ts b/src/components/ha-selector/ha-selector-entity.ts index e6bfba75b5eb..78c7003e1f97 100644 --- a/src/components/ha-selector/ha-selector-entity.ts +++ b/src/components/ha-selector/ha-selector-entity.ts @@ -1,3 +1,4 @@ +import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { customElement, html, @@ -5,13 +6,12 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; -import "../entity/ha-entity-picker"; -import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { subscribeEntityRegistry } from "../../data/entity_registry"; -import { SubscribeMixin } from "../../mixins/subscribe-mixin"; import { EntitySelector } from "../../data/selector"; +import { SubscribeMixin } from "../../mixins/subscribe-mixin"; +import { HomeAssistant } from "../../types"; +import "../entity/ha-entity-picker"; @customElement("ha-selector-entity") export class HaEntitySelector extends SubscribeMixin(LitElement) { diff --git a/src/components/ha-selector/ha-selector-number.ts b/src/components/ha-selector/ha-selector-number.ts index 15d1ff0e23d6..3a819cf9c545 100644 --- a/src/components/ha-selector/ha-selector-number.ts +++ b/src/components/ha-selector/ha-selector-number.ts @@ -1,3 +1,4 @@ +import "@polymer/paper-input/paper-input"; import { css, CSSResult, @@ -6,12 +7,11 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; +import { classMap } from "lit-html/directives/class-map"; +import { fireEvent } from "../../common/dom/fire_event"; import { NumberSelector } from "../../data/selector"; -import "@polymer/paper-input/paper-input"; +import { HomeAssistant } from "../../types"; import "../ha-slider"; -import { fireEvent } from "../../common/dom/fire_event"; -import { classMap } from "lit-html/directives/class-map"; @customElement("ha-selector-number") export class HaNumberSelector extends LitElement { diff --git a/src/components/ha-selector/ha-selector-target.ts b/src/components/ha-selector/ha-selector-target.ts index aa6d2cfdb5fe..23c383e647d1 100644 --- a/src/components/ha-selector/ha-selector-target.ts +++ b/src/components/ha-selector/ha-selector-target.ts @@ -1,3 +1,9 @@ +import "@material/mwc-list/mwc-list"; +import "@material/mwc-list/mwc-list-item"; +import "@material/mwc-tab-bar/mwc-tab-bar"; +import "@material/mwc-tab/mwc-tab"; +import "@polymer/paper-input/paper-input"; +import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -7,23 +13,17 @@ import { LitElement, property, } from "lit-element"; -import { HomeAssistant } from "../../types"; -import { TargetSelector } from "../../data/selector"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; -import "../ha-target-picker"; -import "@material/mwc-list/mwc-list-item"; -import "@polymer/paper-input/paper-input"; -import "@material/mwc-list/mwc-list"; import { EntityRegistryEntry, subscribeEntityRegistry, } from "../../data/entity_registry"; +import { TargetSelector } from "../../data/selector"; import { Target } from "../../data/target"; -import "@material/mwc-tab-bar/mwc-tab-bar"; -import "@material/mwc-tab/mwc-tab"; -import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { SubscribeMixin } from "../../mixins/subscribe-mixin"; +import { HomeAssistant } from "../../types"; +import "../ha-target-picker"; @customElement("ha-selector-target") export class HaTargetSelector extends SubscribeMixin(LitElement) { diff --git a/src/components/ha-selector/ha-selector-time.ts b/src/components/ha-selector/ha-selector-time.ts index 8bfa3d1ec1b6..688b23dad368 100644 --- a/src/components/ha-selector/ha-selector-time.ts +++ b/src/components/ha-selector/ha-selector-time.ts @@ -1,7 +1,7 @@ import { customElement, html, LitElement, property } from "lit-element"; -import { HomeAssistant } from "../../types"; -import { TimeSelector } from "../../data/selector"; import { fireEvent } from "../../common/dom/fire_event"; +import { TimeSelector } from "../../data/selector"; +import { HomeAssistant } from "../../types"; import "../paper-time-input"; const test = new Date().toLocaleString(); diff --git a/src/components/ha-selector/ha-selector.ts b/src/components/ha-selector/ha-selector.ts index 3c88b2da250e..57e22a34f880 100644 --- a/src/components/ha-selector/ha-selector.ts +++ b/src/components/ha-selector/ha-selector.ts @@ -1,16 +1,15 @@ import { customElement, html, LitElement, property } from "lit-element"; import { dynamicElement } from "../../common/dom/dynamic-element-directive"; +import { Selector } from "../../data/selector"; import { HomeAssistant } from "../../types"; - -import "./ha-selector-entity"; -import "./ha-selector-device"; +import "./ha-selector-action"; import "./ha-selector-area"; -import "./ha-selector-target"; -import "./ha-selector-number"; import "./ha-selector-boolean"; +import "./ha-selector-device"; +import "./ha-selector-entity"; +import "./ha-selector-number"; +import "./ha-selector-target"; import "./ha-selector-time"; -import "./ha-selector-action"; -import { Selector } from "../../data/selector"; @customElement("ha-selector") export class HaSelector extends LitElement { diff --git a/src/components/ha-svg-icon.ts b/src/components/ha-svg-icon.ts index 6e58ea5378fb..ecc95d0d4405 100644 --- a/src/components/ha-svg-icon.ts +++ b/src/components/ha-svg-icon.ts @@ -16,7 +16,7 @@ export class HaSvgIcon extends LitElement { protected render(): SVGTemplateResult { return svg` - diff --git a/src/components/ha-tab.ts b/src/components/ha-tab.ts index 4e0f33758fcd..c887c6c44002 100644 --- a/src/components/ha-tab.ts +++ b/src/components/ha-tab.ts @@ -1,21 +1,21 @@ +import type { Ripple } from "@material/mwc-ripple"; +import "@material/mwc-ripple/mwc-ripple"; +import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers"; import { css, CSSResult, customElement, + eventOptions, + html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, - html, queryAsync, - eventOptions, + TemplateResult, } from "lit-element"; -import "@material/mwc-ripple/mwc-ripple"; -import type { Ripple } from "@material/mwc-ripple"; -import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers"; +import { ifDefined } from "lit-html/directives/if-defined"; import "./ha-icon"; import "./ha-svg-icon"; -import { ifDefined } from "lit-html/directives/if-defined"; @customElement("ha-tab") export class HaTab extends LitElement { diff --git a/src/components/ha-tabs.ts b/src/components/ha-tabs.ts index f28f8d77668b..60d724a24770 100644 --- a/src/components/ha-tabs.ts +++ b/src/components/ha-tabs.ts @@ -1,6 +1,6 @@ -import "@polymer/paper-tabs/paper-tabs"; import type { PaperIconButtonElement } from "@polymer/paper-icon-button/paper-icon-button"; import type { PaperTabElement } from "@polymer/paper-tabs/paper-tab"; +import "@polymer/paper-tabs/paper-tabs"; import type { PaperTabsElement } from "@polymer/paper-tabs/paper-tabs"; import { customElement } from "lit-element"; import { Constructor } from "../types"; diff --git a/src/components/ha-target-picker.ts b/src/components/ha-target-picker.ts index 2588846a660b..c324b6b9eb76 100644 --- a/src/components/ha-target-picker.ts +++ b/src/components/ha-target-picker.ts @@ -1,3 +1,16 @@ +// @ts-ignore +import chipStyles from "@material/chips/dist/mdc.chips.min.css"; +import "@material/mwc-button/mwc-button"; +import "@material/mwc-icon-button/mwc-icon-button"; +import { + mdiClose, + mdiDevices, + mdiPlus, + mdiSofa, + mdiUnfoldMoreVertical, +} from "@mdi/js"; +import "@polymer/paper-tooltip/paper-tooltip"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -9,22 +22,12 @@ import { query, unsafeCSS, } from "lit-element"; -import { HomeAssistant } from "../types"; -// @ts-ignore -import chipStyles from "@material/chips/dist/mdc.chips.min.css"; -import { - mdiSofa, - mdiDevices, - mdiClose, - mdiPlus, - mdiUnfoldMoreVertical, -} from "@mdi/js"; -import "./ha-svg-icon"; -import "./ha-icon"; -import "@material/mwc-icon-button/mwc-icon-button"; import { classMap } from "lit-html/directives/class-map"; -import "@material/mwc-button/mwc-button"; -import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { fireEvent } from "../common/dom/fire_event"; +import { ensureArray } from "../common/ensure-array"; +import { computeDomain } from "../common/entity/compute_domain"; +import { computeStateName } from "../common/entity/compute_state_name"; +import { stateIcon } from "../common/entity/state_icon"; import { AreaRegistryEntry, subscribeAreaRegistry, @@ -38,19 +41,16 @@ import { EntityRegistryEntry, subscribeEntityRegistry, } from "../data/entity_registry"; +import { Target } from "../data/target"; import { SubscribeMixin } from "../mixins/subscribe-mixin"; -import { computeStateName } from "../common/entity/compute_state_name"; -import { stateIcon } from "../common/entity/state_icon"; -import { fireEvent } from "../common/dom/fire_event"; +import { HomeAssistant } from "../types"; +import "./device/ha-device-picker"; import type { HaDevicePickerDeviceFilterFunc } from "./device/ha-device-picker"; -import { computeDomain } from "../common/entity/compute_domain"; -import { Target } from "../data/target"; -import { ensureArray } from "../common/ensure-array"; import "./entity/ha-entity-picker"; -import "./device/ha-device-picker"; -import "./ha-area-picker"; import type { HaEntityPickerEntityFilterFunc } from "./entity/ha-entity-picker"; -import "@polymer/paper-tooltip/paper-tooltip"; +import "./ha-area-picker"; +import "./ha-icon"; +import "./ha-svg-icon"; @customElement("ha-target-picker") export class HaTargetPicker extends SubscribeMixin(LitElement) { diff --git a/src/components/ha-water_heater-control.js b/src/components/ha-water_heater-control.js index ace62634d092..9a3403b36dbe 100644 --- a/src/components/ha-water_heater-control.js +++ b/src/components/ha-water_heater-control.js @@ -1,9 +1,9 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes"; -import "./ha-icon-button"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { EventsMixin } from "../mixins/events-mixin"; +import "./ha-icon-button"; /* * @appliesMixin EventsMixin diff --git a/src/components/ha-yaml-editor.ts b/src/components/ha-yaml-editor.ts index 4d2f4c2c5988..473a7dd41a25 100644 --- a/src/components/ha-yaml-editor.ts +++ b/src/components/ha-yaml-editor.ts @@ -2,9 +2,9 @@ import { safeDump, safeLoad } from "js-yaml"; import { customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; diff --git a/src/components/map/ha-locations-editor.ts b/src/components/map/ha-locations-editor.ts index 8b67b9ff2e91..184813c32e07 100644 --- a/src/components/map/ha-locations-editor.ts +++ b/src/components/map/ha-locations-editor.ts @@ -21,8 +21,8 @@ import { import { fireEvent } from "../../common/dom/fire_event"; import { LeafletModuleType, - setupLeafletMap, replaceTileLayer, + setupLeafletMap, } from "../../common/dom/setup-leaflet-map"; import { defaultRadiusColor } from "../../data/zone"; import { HomeAssistant } from "../../types"; diff --git a/src/components/map/ha-map.ts b/src/components/map/ha-map.ts index b4bb36ea2555..98113ab10028 100644 --- a/src/components/map/ha-map.ts +++ b/src/components/map/ha-map.ts @@ -1,4 +1,3 @@ -import "../ha-icon-button"; import { Circle, Layer, Map, Marker, TileLayer } from "leaflet"; import { css, @@ -12,14 +11,15 @@ import { } from "lit-element"; import { LeafletModuleType, - setupLeafletMap, replaceTileLayer, + setupLeafletMap, } from "../../common/dom/setup-leaflet-map"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; import { debounce } from "../../common/util/debounce"; import "../../panels/map/ha-entity-marker"; import { HomeAssistant } from "../../types"; +import "../ha-icon-button"; @customElement("ha-map") class HaMap extends LitElement { diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index f1fbfab1d6b9..4bcd1960f182 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -1,5 +1,4 @@ import "@material/mwc-button/mwc-button"; -import "../ha-fab"; import "@material/mwc-list/mwc-list"; import "@material/mwc-list/mwc-list-item"; import { mdiArrowLeft, mdiClose, mdiPlay, mdiPlus } from "@mdi/js"; @@ -43,6 +42,7 @@ import "../entity/ha-entity-picker"; import "../ha-button-menu"; import "../ha-card"; import "../ha-circular-progress"; +import "../ha-fab"; import "../ha-paper-dropdown-menu"; import "../ha-svg-icon"; diff --git a/src/components/state-history-charts.js b/src/components/state-history-charts.js index 3127f00fac75..2f3a2780c24e 100644 --- a/src/components/state-history-charts.js +++ b/src/components/state-history-charts.js @@ -1,8 +1,8 @@ -import "./ha-circular-progress"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import LocalizeMixin from "../mixins/localize-mixin"; +import "./ha-circular-progress"; import "./state-history-chart-line"; import "./state-history-chart-timeline"; diff --git a/src/components/user/ha-user-picker.ts b/src/components/user/ha-user-picker.ts index 6b3e865c0586..e8cd417bc662 100644 --- a/src/components/user/ha-user-picker.ts +++ b/src/components/user/ha-user-picker.ts @@ -1,5 +1,4 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; -import "../ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; @@ -17,6 +16,7 @@ import { fireEvent } from "../../common/dom/fire_event"; import { compare } from "../../common/string/compare"; import { fetchUsers, User } from "../../data/user"; import { HomeAssistant } from "../../types"; +import "../ha-icon-button"; import "./ha-user-badge"; class HaUserPicker extends LitElement { diff --git a/src/components/user/ha-users-picker.ts b/src/components/user/ha-users-picker.ts index d4fac81d4811..36a801259655 100644 --- a/src/components/user/ha-users-picker.ts +++ b/src/components/user/ha-users-picker.ts @@ -1,3 +1,4 @@ +import { mdiClose } from "@mdi/js"; import { css, CSSResult, @@ -7,14 +8,13 @@ import { property, TemplateResult, } from "lit-element"; +import { guard } from "lit-html/directives/guard"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; +import { fetchUsers, User } from "../../data/user"; import type { PolymerChangedEvent } from "../../polymer-types"; import type { HomeAssistant } from "../../types"; -import { fetchUsers, User } from "../../data/user"; import "./ha-user-picker"; -import { mdiClose } from "@mdi/js"; -import memoizeOne from "memoize-one"; -import { guard } from "lit-html/directives/guard"; @customElement("ha-users-picker") class HaUsersPickerLight extends LitElement { diff --git a/src/data/area_registry.ts b/src/data/area_registry.ts index d59a7ff69d15..563af65b47c6 100644 --- a/src/data/area_registry.ts +++ b/src/data/area_registry.ts @@ -1,8 +1,8 @@ import { Connection, createCollection } from "home-assistant-js-websocket"; +import { Store } from "home-assistant-js-websocket/dist/store"; import { compare } from "../common/string/compare"; import { debounce } from "../common/util/debounce"; import { HomeAssistant } from "../types"; -import { Store } from "home-assistant-js-websocket/dist/store"; export interface AreaRegistryEntry { area_id: string; diff --git a/src/data/calendar.ts b/src/data/calendar.ts index fc27c71253b3..0080a2bc5c15 100644 --- a/src/data/calendar.ts +++ b/src/data/calendar.ts @@ -1,7 +1,7 @@ -import type { HomeAssistant, CalendarEvent } from "../types"; -import { computeDomain } from "../common/entity/compute_domain"; import { HA_COLOR_PALETTE } from "../common/const"; +import { computeDomain } from "../common/entity/compute_domain"; import { computeStateName } from "../common/entity/compute_state_name"; +import type { CalendarEvent, HomeAssistant } from "../types"; export interface Calendar { entity_id: string; diff --git a/src/data/device_automation.ts b/src/data/device_automation.ts index 5fd7714f7f20..8319f8772b86 100644 --- a/src/data/device_automation.ts +++ b/src/data/device_automation.ts @@ -1,6 +1,6 @@ import { computeStateName } from "../common/entity/compute_state_name"; -import { HomeAssistant } from "../types"; import { HaFormSchema } from "../components/ha-form/ha-form"; +import { HomeAssistant } from "../types"; export interface DeviceAutomation { device_id: string; diff --git a/src/data/iconsets.ts b/src/data/iconsets.ts index 941f84cd746f..2e6df41914da 100644 --- a/src/data/iconsets.ts +++ b/src/data/iconsets.ts @@ -1,6 +1,6 @@ +import { clear, get, set, Store } from "idb-keyval"; import { iconMetadata } from "../resources/icon-metadata"; import { IconMeta } from "../types"; -import { get, set, clear, Store } from "idb-keyval"; export interface Icons { [key: string]: string; diff --git a/src/data/media-player.ts b/src/data/media-player.ts index 84a7d03034e5..95b5156c3337 100644 --- a/src/data/media-player.ts +++ b/src/data/media-player.ts @@ -20,9 +20,9 @@ import type { HassEntityAttributeBase, HassEntityBase, } from "home-assistant-js-websocket"; +import { supportsFeature } from "../common/entity/supports-feature"; import type { HomeAssistant } from "../types"; import { UNAVAILABLE_STATES } from "./entity"; -import { supportsFeature } from "../common/entity/supports-feature"; interface MediaPlayerEntityAttributes extends HassEntityAttributeBase { media_content_type?: any; diff --git a/src/data/tag.ts b/src/data/tag.ts index 870777f7cb56..b3d4c7bd8634 100644 --- a/src/data/tag.ts +++ b/src/data/tag.ts @@ -1,5 +1,5 @@ -import { HomeAssistant } from "../types"; import { HassEventBase } from "home-assistant-js-websocket"; +import { HomeAssistant } from "../types"; export const EVENT_TAG_SCANNED = "tag_scanned"; diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts index 54ab1c7f41c8..ece523c8faf4 100644 --- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts +++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts @@ -4,16 +4,17 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; -import "../../components/ha-dialog"; +import { fireEvent } from "../../common/dom/fire_event"; +import { computeRTLDirection } from "../../common/util/compute_rtl"; import "../../components/ha-circular-progress"; -import "../../components/ha-switch"; +import "../../components/ha-dialog"; import "../../components/ha-formfield"; -import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-switch"; import type { HaSwitch } from "../../components/ha-switch"; import { getConfigEntrySystemOptions, @@ -22,7 +23,6 @@ import { import { haStyleDialog } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; import { ConfigEntrySystemOptionsDialogParams } from "./show-dialog-config-entry-system-options"; -import { computeRTLDirection } from "../../common/util/compute_rtl"; @customElement("dialog-config-entry-system-options") class DialogConfigEntrySystemOptions extends LitElement { diff --git a/src/dialogs/config-flow/step-flow-pick-handler.ts b/src/dialogs/config-flow/step-flow-pick-handler.ts index a95f31637b90..774c9778b083 100644 --- a/src/dialogs/config-flow/step-flow-pick-handler.ts +++ b/src/dialogs/config-flow/step-flow-pick-handler.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; @@ -20,10 +20,10 @@ import { LocalizeFunc } from "../../common/translations/localize"; import "../../components/ha-icon-next"; import { domainToName } from "../../data/integration"; import { HomeAssistant } from "../../types"; +import { brandsUrl } from "../../util/brands-url"; import { documentationUrl } from "../../util/documentation-url"; import { FlowConfig } from "./show-dialog-data-entry-flow"; import { configFlowContentStyles } from "./styles"; -import { brandsUrl } from "../../util/brands-url"; interface HandlerObj { name: string; diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index c2ab0ca14835..82dd0bc9585c 100644 --- a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts +++ b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts @@ -15,11 +15,11 @@ import { TemplateResult, unsafeCSS, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import "../../components/ha-dialog"; import { haStyleDialog } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; import { HaImageCropperDialogParams } from "./show-image-cropper-dialog"; -import { classMap } from "lit-html/directives/class-map"; @customElement("image-cropper-dialog") export class HaImagecropperDialog extends LitElement { diff --git a/src/dialogs/more-info/controls/more-info-automation.ts b/src/dialogs/more-info/controls/more-info-automation.ts index 6a1a789b9974..880dae7bb044 100644 --- a/src/dialogs/more-info/controls/more-info-automation.ts +++ b/src/dialogs/more-info/controls/more-info-automation.ts @@ -11,8 +11,8 @@ import { } from "lit-element"; import "../../../components/ha-relative-time"; import { triggerAutomation } from "../../../data/automation"; -import { HomeAssistant } from "../../../types"; import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { HomeAssistant } from "../../../types"; @customElement("more-info-automation") class MoreInfoAutomation extends LitElement { diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 5dc4a004ce42..ef54fa302f4b 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -13,11 +13,11 @@ import { import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-camera-stream"; import { + CameraEntity, CameraPreferences, CAMERA_SUPPORT_STREAM, fetchCameraPrefs, updateCameraPrefs, - CameraEntity, } from "../../../data/camera"; import type { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-configurator.js b/src/dialogs/more-info/controls/more-info-configurator.js index 4fb706631d4d..da7a9e6f97b4 100644 --- a/src/dialogs/more-info/controls/more-info-configurator.js +++ b/src/dialogs/more-info/controls/more-info-configurator.js @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/iron-flex-layout/iron-flex-layout-classes"; import "@polymer/iron-input/iron-input"; import "@polymer/paper-input/paper-input"; -import "../../../components/ha-circular-progress"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; +import "../../../components/ha-circular-progress"; import "../../../components/ha-markdown"; class MoreInfoConfigurator extends PolymerElement { diff --git a/src/dialogs/more-info/controls/more-info-counter.ts b/src/dialogs/more-info/controls/more-info-counter.ts index 64353f0407ea..330f504f5045 100644 --- a/src/dialogs/more-info/controls/more-info-counter.ts +++ b/src/dialogs/more-info/controls/more-info-counter.ts @@ -9,8 +9,8 @@ import { property, TemplateResult, } from "lit-element"; -import { HomeAssistant } from "../../../types"; import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { HomeAssistant } from "../../../types"; @customElement("more-info-counter") class MoreInfoCounter extends LitElement { diff --git a/src/dialogs/more-info/controls/more-info-fan.js b/src/dialogs/more-info/controls/more-info-fan.js index e7e1b9c810cc..fde009e367db 100644 --- a/src/dialogs/more-info/controls/more-info-fan.js +++ b/src/dialogs/more-info/controls/more-info-fan.js @@ -1,5 +1,4 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes"; -import "../../../components/ha-icon-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { html } from "@polymer/polymer/lib/utils/html-tag"; @@ -7,6 +6,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; import { attributeClassNames } from "../../../common/entity/attribute_class_names"; import "../../../components/ha-attributes"; +import "../../../components/ha-icon-button"; import "../../../components/ha-paper-dropdown-menu"; import "../../../components/ha-switch"; import { EventsMixin } from "../../../mixins/events-mixin"; diff --git a/src/dialogs/more-info/controls/more-info-group.ts b/src/dialogs/more-info/controls/more-info-group.ts index da06adf93528..615bf3314d10 100644 --- a/src/dialogs/more-info/controls/more-info-group.ts +++ b/src/dialogs/more-info/controls/more-info-group.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { - LitElement, - property, - CSSResult, css, + CSSResult, internalProperty, + LitElement, + property, PropertyValues, } from "lit-element"; import { html, TemplateResult } from "lit-html"; @@ -14,8 +14,8 @@ import { GroupEntity } from "../../../data/group"; import "../../../state-summary/state-card-content"; import { HomeAssistant } from "../../../types"; import { - importMoreInfoControl, domainMoreInfoType, + importMoreInfoControl, } from "../state_more_info_control"; class MoreInfoGroup extends LitElement { diff --git a/src/dialogs/more-info/controls/more-info-input_datetime.js b/src/dialogs/more-info/controls/more-info-input_datetime.js index b2e8c4453ec4..fad03c408a58 100644 --- a/src/dialogs/more-info/controls/more-info-input_datetime.js +++ b/src/dialogs/more-info/controls/more-info-input_datetime.js @@ -3,8 +3,8 @@ import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import "../../../components/ha-date-input"; import { attributeClassNames } from "../../../common/entity/attribute_class_names"; +import "../../../components/ha-date-input"; import "../../../components/ha-relative-time"; import "../../../components/paper-time-input"; diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index 9296454f727c..2ac9af776d74 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -19,12 +19,12 @@ import "../../../components/ha-icon-button"; import "../../../components/ha-labeled-slider"; import "../../../components/ha-paper-dropdown-menu"; import { + LightEntity, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_EFFECT, SUPPORT_WHITE_VALUE, - LightEntity, } from "../../../data/light"; import type { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-media_player.ts b/src/dialogs/more-info/controls/more-info-media_player.ts index 48e9432a96d3..95ebc74d2699 100644 --- a/src/dialogs/more-info/controls/more-info-media_player.ts +++ b/src/dialogs/more-info/controls/more-info-media_player.ts @@ -27,6 +27,7 @@ import { UNAVAILABLE, UNAVAILABLE_STATES, UNKNOWN } from "../../../data/entity"; import { computeMediaControls, MediaPickedEvent, + MediaPlayerEntity, SUPPORT_BROWSE_MEDIA, SUPPORT_PLAY_MEDIA, SUPPORT_SELECT_SOUND_MODE, @@ -34,7 +35,6 @@ import { SUPPORT_VOLUME_BUTTONS, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, - MediaPlayerEntity, } from "../../../data/media-player"; import { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-vacuum.ts b/src/dialogs/more-info/controls/more-info-vacuum.ts index 8fbc1a1dd371..1e862c474a08 100644 --- a/src/dialogs/more-info/controls/more-info-vacuum.ts +++ b/src/dialogs/more-info/controls/more-info-vacuum.ts @@ -1,5 +1,3 @@ -import "../../../components/ha-icon-button"; -import "../../../components/ha-icon"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { @@ -13,6 +11,8 @@ import { } from "lit-element"; import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-attributes"; +import "../../../components/ha-icon"; +import "../../../components/ha-icon-button"; import "../../../components/ha-paper-dropdown-menu"; import { VacuumEntity, diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts index 4d3c38ca908d..56018d8316ba 100644 --- a/src/dialogs/more-info/controls/more-info-weather.ts +++ b/src/dialogs/more-info/controls/more-info-weather.ts @@ -1,18 +1,3 @@ -import "../../../components/ha-svg-icon"; -import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResult, - customElement, - LitElement, - property, - PropertyValues, -} from "lit-element"; -import { html, TemplateResult } from "lit-html"; -import { HomeAssistant } from "../../../types"; - -import { getWind, getWeatherUnit } from "../../../data/weather"; - import { mdiAlertCircleOutline, mdiEye, @@ -34,7 +19,20 @@ import { mdiWeatherWindy, mdiWeatherWindyVariant, } from "@mdi/js"; +import { HassEntity } from "home-assistant-js-websocket"; +import { + css, + CSSResult, + customElement, + LitElement, + property, + PropertyValues, +} from "lit-element"; +import { html, TemplateResult } from "lit-html"; import { formatNumber } from "../../../common/string/format_number"; +import "../../../components/ha-svg-icon"; +import { getWeatherUnit, getWind } from "../../../data/weather"; +import { HomeAssistant } from "../../../types"; const weatherIcons = { "clear-night": mdiWeatherNight, diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 3feedb9a504e..5e116e9cef27 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -20,21 +20,20 @@ import { import { fireEvent } from "../../common/dom/fire_event"; import { computeDomain } from "../../common/entity/compute_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; - import { navigate } from "../../common/navigate"; import "../../components/ha-dialog"; import "../../components/ha-header-bar"; import "../../components/ha-svg-icon"; import { removeEntityRegistryEntry } from "../../data/entity_registry"; +import { CONTINUOUS_DOMAINS } from "../../data/logbook"; import { showEntityEditorDialog } from "../../panels/config/entities/show-dialog-entity-editor"; import { haStyleDialog } from "../../resources/styles"; import "../../state-summary/state-card-content"; import { HomeAssistant } from "../../types"; import { showConfirmationDialog } from "../generic/show-dialog-box"; +import "./controls/more-info-default"; import "./ha-more-info-history"; import "./ha-more-info-logbook"; -import "./controls/more-info-default"; -import { CONTINUOUS_DOMAINS } from "../../data/logbook"; import "./more-info-content"; const DOMAINS_NO_INFO = ["camera", "configurator"]; diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index 47570226fa23..d08ae9507a34 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -1,10 +1,9 @@ import { HassEntity } from "home-assistant-js-websocket"; import { property, PropertyValues, UpdatingElement } from "lit-element"; - -import { HomeAssistant } from "../../types"; import dynamicContentUpdater from "../../common/dom/dynamic_content_updater"; -import { stateMoreInfoType } from "./state_more_info_control"; import { importMoreInfoControl } from "../../panels/lovelace/custom-card-helpers"; +import { HomeAssistant } from "../../types"; +import { stateMoreInfoType } from "./state_more_info_control"; class MoreInfoContent extends UpdatingElement { @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/dialogs/notifications/notification-drawer.js b/src/dialogs/notifications/notification-drawer.js index d15ac9985723..37a9582749b7 100644 --- a/src/dialogs/notifications/notification-drawer.js +++ b/src/dialogs/notifications/notification-drawer.js @@ -63,8 +63,8 @@ export class HuiNotificationDrawer extends EventsMixin(
[[localize('ui.notification_drawer.title')]]
- diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index 90ab5b654ec6..4db3b6926007 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -18,11 +18,13 @@ import { ifDefined } from "lit-html/directives/if-defined"; import { styleMap } from "lit-html/directives/style-map"; import { scroll } from "lit-virtualizer"; import memoizeOne from "memoize-one"; +import { canShowPage } from "../../common/config/can_show_page"; import { componentsWithService } from "../../common/config/components_with_service"; import { fireEvent } from "../../common/dom/fire_event"; import { computeDomain } from "../../common/entity/compute_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; import { domainIcon } from "../../common/entity/domain_icon"; +import { navigate } from "../../common/navigate"; import "../../common/search/search-input"; import { compare } from "../../common/string/compare"; import { @@ -34,6 +36,9 @@ import "../../components/ha-circular-progress"; import "../../components/ha-dialog"; import "../../components/ha-header-bar"; import { domainToName } from "../../data/integration"; +import { getPanelIcon, getPanelNameTranslationKey } from "../../data/panel"; +import { PageNavigation } from "../../layouts/hass-tabs-subpage"; +import { configSections } from "../../panels/config/ha-panel-config"; import { haStyleDialog } from "../../resources/styles"; import { HomeAssistant } from "../../types"; import { @@ -41,11 +46,6 @@ import { showConfirmationDialog, } from "../generic/show-dialog-box"; import { QuickBarParams } from "./show-dialog-quick-bar"; -import { navigate } from "../../common/navigate"; -import { configSections } from "../../panels/config/ha-panel-config"; -import { PageNavigation } from "../../layouts/hass-tabs-subpage"; -import { canShowPage } from "../../common/config/can_show_page"; -import { getPanelIcon, getPanelNameTranslationKey } from "../../data/panel"; const DEFAULT_NAVIGATION_ICON = "hass:arrow-right-circle"; const DEFAULT_SERVER_ICON = "hass:server"; diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index 305d3206c852..31c573e52d9c 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -1,6 +1,5 @@ import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import type { PaperDialogScrollableElement } from "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; -import "../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { @@ -8,9 +7,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, query, TemplateResult, @@ -20,6 +19,7 @@ import { fireEvent } from "../../common/dom/fire_event"; import { SpeechRecognition } from "../../common/dom/speech-recognition"; import { uid } from "../../common/util/uid"; import "../../components/dialog/ha-paper-dialog"; +import "../../components/ha-icon-button"; import { AgentInfo, getAgentInfo, diff --git a/src/entrypoints/app.ts b/src/entrypoints/app.ts index a4dd8580d491..39c5f4c493f9 100644 --- a/src/entrypoints/app.ts +++ b/src/entrypoints/app.ts @@ -1,7 +1,7 @@ import { setPassiveTouchGestures } from "@polymer/polymer/lib/utils/settings"; -import "../resources/roboto"; -import "../resources/ha-style"; import "../layouts/home-assistant"; +import "../resources/ha-style"; +import "../resources/roboto"; import "../util/legacy-support"; setPassiveTouchGestures(true); diff --git a/src/entrypoints/authorize.ts b/src/entrypoints/authorize.ts index 734551583b7d..3a5432c64c2a 100644 --- a/src/entrypoints/authorize.ts +++ b/src/entrypoints/authorize.ts @@ -1,11 +1,11 @@ // Compat needs to be first import -import "../resources/compatibility"; -import "../resources/safari-14-attachshadow-patch"; import "@polymer/polymer/lib/elements/dom-if"; import "@polymer/polymer/lib/elements/dom-repeat"; import "../auth/ha-authorize"; +import "../resources/compatibility"; import "../resources/ha-style"; import "../resources/roboto"; +import "../resources/safari-14-attachshadow-patch"; /* polyfill for paper-dropdown */ setTimeout( diff --git a/src/entrypoints/core.ts b/src/entrypoints/core.ts index aec93bb259a8..baab96734e13 100644 --- a/src/entrypoints/core.ts +++ b/src/entrypoints/core.ts @@ -1,6 +1,4 @@ // Compat needs to be first import -import "../resources/compatibility"; -import "../resources/safari-14-attachshadow-patch"; import { Auth, Connection, @@ -24,6 +22,8 @@ import { subscribePanels } from "../data/ws-panels"; import { subscribeThemes } from "../data/ws-themes"; import { subscribeUser } from "../data/ws-user"; import type { ExternalAuth } from "../external_app/external_auth"; +import "../resources/compatibility"; +import "../resources/safari-14-attachshadow-patch"; import { HomeAssistant } from "../types"; declare global { diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index bbb9320c4164..5ccb0aa2c1af 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -1,10 +1,10 @@ -import "../resources/compatibility"; -import "../resources/safari-14-attachshadow-patch"; import { PolymerElement } from "@polymer/polymer"; import { fireEvent } from "../common/dom/fire_event"; import { loadJS } from "../common/dom/load_resource"; import { webComponentsSupported } from "../common/feature-detect/support-web-components"; import { CustomPanelInfo } from "../data/panel_custom"; +import "../resources/compatibility"; +import "../resources/safari-14-attachshadow-patch"; import { createCustomPanelElement } from "../util/custom-panel/create-custom-panel-element"; import { loadCustomPanel } from "../util/custom-panel/load-custom-panel"; import { setCustomPanelProperties } from "../util/custom-panel/set-custom-panel-properties"; diff --git a/src/entrypoints/onboarding.ts b/src/entrypoints/onboarding.ts index 56054746e86e..1ab99556a91a 100644 --- a/src/entrypoints/onboarding.ts +++ b/src/entrypoints/onboarding.ts @@ -1,9 +1,9 @@ // Compat needs to be first import -import "../resources/compatibility"; -import "../resources/safari-14-attachshadow-patch"; import "../onboarding/ha-onboarding"; +import "../resources/compatibility"; import "../resources/ha-style"; import "../resources/roboto"; +import "../resources/safari-14-attachshadow-patch"; declare global { interface Window { diff --git a/src/entrypoints/service_worker.ts b/src/entrypoints/service_worker.ts index 5ecb5f723fb0..cd536e7d189f 100644 --- a/src/entrypoints/service_worker.ts +++ b/src/entrypoints/service_worker.ts @@ -2,14 +2,14 @@ // eslint-disable-next-line spaced-comment /// /* eslint-env serviceworker */ +import { cacheNames } from "workbox-core"; +import { cleanupOutdatedCaches, precacheAndRoute } from "workbox-precaching"; +import { registerRoute } from "workbox-routing"; import { CacheFirst, - StaleWhileRevalidate, NetworkOnly, + StaleWhileRevalidate, } from "workbox-strategies"; -import { cleanupOutdatedCaches, precacheAndRoute } from "workbox-precaching"; -import { registerRoute } from "workbox-routing"; -import { cacheNames } from "workbox-core"; // Clean up caches from older workboxes and old service workers. // Will help with cleaning up Workbox v4 stuff diff --git a/src/layouts/ha-init-page.ts b/src/layouts/ha-init-page.ts index 6ceb2cafb398..e659110e01e2 100644 --- a/src/layouts/ha-init-page.ts +++ b/src/layouts/ha-init-page.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, CSSResult, html, LitElement, property } from "lit-element"; -import { removeInitSkeleton } from "../util/init-skeleton"; import "../components/ha-circular-progress"; +import { removeInitSkeleton } from "../util/init-skeleton"; class HaInitPage extends LitElement { @property({ type: Boolean }) public error = false; diff --git a/src/layouts/hass-error-screen.ts b/src/layouts/hass-error-screen.ts index fafa6e6fd348..db0b3a671e03 100644 --- a/src/layouts/hass-error-screen.ts +++ b/src/layouts/hass-error-screen.ts @@ -8,8 +8,8 @@ import { property, TemplateResult, } from "lit-element"; -import "./hass-subpage"; import { HomeAssistant } from "../types"; +import "./hass-subpage"; @customElement("hass-error-screen") class HassErrorScreen extends LitElement { diff --git a/src/layouts/hass-loading-screen.ts b/src/layouts/hass-loading-screen.ts index 8683d7863000..ae7d41e8ea2d 100644 --- a/src/layouts/hass-loading-screen.ts +++ b/src/layouts/hass-loading-screen.ts @@ -9,8 +9,8 @@ import { TemplateResult, } from "lit-element"; import "../components/ha-circular-progress"; -import "../components/ha-menu-button"; import "../components/ha-icon-button-arrow-prev"; +import "../components/ha-menu-button"; import { haStyle } from "../resources/styles"; import { HomeAssistant } from "../types"; diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index 69a42f2fff1b..fa5cdbf3c07b 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -2,16 +2,16 @@ import { css, CSSResult, customElement, + eventOptions, html, LitElement, property, TemplateResult, - eventOptions, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; -import "../components/ha-menu-button"; -import "../components/ha-icon-button-arrow-prev"; import { restoreScroll } from "../common/decorators/restore-scroll"; +import "../components/ha-icon-button-arrow-prev"; +import "../components/ha-menu-button"; import { HomeAssistant } from "../types"; @customElement("hass-subpage") diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index a81338479314..1ec55ca9aa69 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -1,23 +1,23 @@ import "@polymer/app-route/app-location"; import { + customElement, html, internalProperty, PropertyValues, - customElement, } from "lit-element"; import { navigate } from "../common/navigate"; import { getStorageDefaultPanelUrlPath } from "../data/panel"; import "../resources/custom-card-support"; import { HassElement } from "../state/hass-element"; +import QuickBarMixin from "../state/quick-bar-mixin"; import { HomeAssistant, Route } from "../types"; +import { storeState } from "../util/ha-pref-storage"; import { registerServiceWorker, supportsServiceWorker, } from "../util/register-service-worker"; import "./ha-init-page"; import "./home-assistant-main"; -import { storeState } from "../util/ha-pref-storage"; -import QuickBarMixin from "../state/quick-bar-mixin"; @customElement("home-assistant") export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { diff --git a/src/managers/notification-manager.ts b/src/managers/notification-manager.ts index a2db48db895b..a282adfd784c 100644 --- a/src/managers/notification-manager.ts +++ b/src/managers/notification-manager.ts @@ -3,9 +3,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index 019642fcbcac..a2e852d6b131 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -296,7 +296,7 @@ export class HAFullCalendar extends LitElement { ${unsafeCSS(fullcalendarStyle)} ${unsafeCSS(daygridStyle)} ${unsafeCSS(listStyle)} - + :host { display: flex; flex-direction: column; @@ -368,7 +368,7 @@ export class HAFullCalendar extends LitElement { } a { - color: inherit !important; + color: inherit !important; } .fc-theme-standard .fc-scrollgrid { diff --git a/src/panels/config/areas/dialog-area-registry-detail.ts b/src/panels/config/areas/dialog-area-registry-detail.ts index 7e1590d010ea..e0c5c4846723 100644 --- a/src/panels/config/areas/dialog-area-registry-detail.ts +++ b/src/panels/config/areas/dialog-area-registry-detail.ts @@ -5,19 +5,19 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; +import { navigate } from "../../../common/navigate"; import "../../../components/ha-dialog"; import { AreaRegistryEntryMutableParams } from "../../../data/area_registry"; import { PolymerChangedEvent } from "../../../polymer-types"; import { haStyleDialog } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; import { AreaRegistryDetailDialogParams } from "./show-dialog-area-registry-detail"; -import { navigate } from "../../../common/navigate"; class DialogAreaDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index 66cea0e01bed..ad00f8e87118 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -18,6 +17,7 @@ import { DataTableColumnContainer, RowClickedEvent, } from "../../../components/data-table/ha-data-table"; +import "../../../components/ha-fab"; import "../../../components/ha-icon-button"; import "../../../components/ha-svg-icon"; import { diff --git a/src/panels/config/areas/ha-config-areas.ts b/src/panels/config/areas/ha-config-areas.ts index 1c00eb4f98fa..fc9ead40624f 100644 --- a/src/panels/config/areas/ha-config-areas.ts +++ b/src/panels/config/areas/ha-config-areas.ts @@ -1,8 +1,8 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { customElement, - property, internalProperty, + property, PropertyValues, } from "lit-element"; import { compare } from "../../../common/string/compare"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts index b75c5cce7bf2..051b3a8889f9 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts @@ -1,9 +1,9 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, } from "lit-element"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; @@ -13,8 +13,8 @@ import "../../../../../components/ha-form/ha-form"; import { DeviceAction, deviceAutomationsEqual, - fetchDeviceActionCapabilities, DeviceCapabilities, + fetchDeviceActionCapabilities, } from "../../../../../data/device_automation"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts index 6755816afe31..d34468c7d367 100644 --- a/src/panels/config/automation/blueprint-automation-editor.ts +++ b/src/panels/config/automation/blueprint-automation-editor.ts @@ -1,3 +1,7 @@ +import "@material/mwc-button/mwc-button"; +import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; +import "@polymer/paper-input/paper-textarea"; +import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -7,29 +11,25 @@ import { property, } from "lit-element"; import { html } from "lit-html"; +import { fireEvent } from "../../../common/dom/fire_event"; +import "../../../components/entity/ha-entity-toggle"; +import "../../../components/ha-blueprint-picker"; +import "../../../components/ha-card"; +import "../../../components/ha-circular-progress"; +import "../../../components/ha-selector/ha-selector"; +import "../../../components/ha-settings-row"; import { BlueprintAutomationConfig, triggerAutomation, } from "../../../data/automation"; -import { HomeAssistant } from "../../../types"; -import "../ha-config-section"; -import "../../../components/ha-card"; -import "@polymer/paper-input/paper-textarea"; -import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; -import "../../../components/entity/ha-entity-toggle"; -import "@material/mwc-button/mwc-button"; -import { fireEvent } from "../../../common/dom/fire_event"; -import { haStyle } from "../../../resources/styles"; -import { HassEntity } from "home-assistant-js-websocket"; import { BlueprintOrError, Blueprints, fetchBlueprints, } from "../../../data/blueprint"; -import "../../../components/ha-blueprint-picker"; -import "../../../components/ha-circular-progress"; -import "../../../components/ha-selector/ha-selector"; -import "../../../components/ha-settings-row"; +import { haStyle } from "../../../resources/styles"; +import { HomeAssistant } from "../../../types"; +import "../ha-config-section"; @customElement("blueprint-automation-editor") export class HaBlueprintAutomationEditor extends LitElement { diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index 9f3f0d91f17f..42dd2c34d8bc 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -3,18 +3,19 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; import { + CSSResult, customElement, html, LitElement, property, - CSSResult, } from "lit-element"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; +import "../../../../components/ha-yaml-editor"; import type { Condition } from "../../../../data/automation"; +import { haStyle } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; -import "../../../../components/ha-yaml-editor"; import "./types/ha-automation-condition-and"; import "./types/ha-automation-condition-device"; import "./types/ha-automation-condition-not"; @@ -25,7 +26,6 @@ import "./types/ha-automation-condition-sun"; import "./types/ha-automation-condition-template"; import "./types/ha-automation-condition-time"; import "./types/ha-automation-condition-zone"; -import { haStyle } from "../../../../resources/styles"; const OPTIONS = [ "device", diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts index c60face55a09..44707245480f 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts @@ -1,22 +1,22 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, } from "lit-element"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-condition-picker"; import "../../../../../components/device/ha-device-picker"; import "../../../../../components/ha-form/ha-form"; import { deviceAutomationsEqual, + DeviceCapabilities, DeviceCondition, fetchDeviceConditionCapabilities, - DeviceCapabilities, } from "../../../../../data/device_automation"; import { HomeAssistant } from "../../../../../types"; -import memoizeOne from "memoize-one"; @customElement("ha-automation-condition-device") export class HaDeviceCondition extends LitElement { diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts index e226d9534a89..6f8fe2329ec2 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts @@ -1,5 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; import "@polymer/paper-input/paper-textarea"; +import { customElement, html, LitElement, property } from "lit-element"; import { TemplateCondition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-condition-row"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts index 0180a7494f5f..87b22ef223aa 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts @@ -1,25 +1,25 @@ import { Radio } from "@material/mwc-radio"; import "@polymer/paper-input/paper-input"; import { + css, + CSSResult, customElement, html, internalProperty, LitElement, property, - CSSResult, - css, } from "lit-element"; +import { fireEvent } from "../../../../../common/dom/fire_event"; +import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/ha-formfield"; import "../../../../../components/ha-radio"; +import { HaSwitch } from "../../../../../components/ha-switch"; import { TimeCondition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { ConditionElement, handleChangeEvent, } from "../ha-automation-condition-row"; -import { HaSwitch } from "../../../../../components/ha-switch"; -import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; -import { fireEvent } from "../../../../../common/dom/fire_event"; const includeDomains = ["input_datetime"]; diff --git a/src/panels/config/automation/dialog-new-automation.ts b/src/panels/config/automation/dialog-new-automation.ts index cf9a5c965de1..3815eee8b018 100644 --- a/src/panels/config/automation/dialog-new-automation.ts +++ b/src/panels/config/automation/dialog-new-automation.ts @@ -1,27 +1,27 @@ import "@material/mwc-button"; -import "../../../components/ha-circular-progress"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; -import "../../../components/ha-dialog"; -import { haStyle, haStyleDialog } from "../../../resources/styles"; -import type { HomeAssistant } from "../../../types"; -import { fireEvent } from "../../../common/dom/fire_event"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; +import { fireEvent } from "../../../common/dom/fire_event"; +import "../../../components/ha-blueprint-picker"; +import "../../../components/ha-card"; +import "../../../components/ha-circular-progress"; +import "../../../components/ha-dialog"; import { AutomationConfig, showAutomationEditor, } from "../../../data/automation"; +import { haStyle, haStyleDialog } from "../../../resources/styles"; +import type { HomeAssistant } from "../../../types"; import { showThingtalkDialog } from "./thingtalk/show-dialog-thingtalk"; -import "../../../components/ha-card"; -import "../../../components/ha-blueprint-picker"; @customElement("ha-dialog-new-automation") class DialogNewAutomation extends LitElement { diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 996daed1736b..9aa7c0b538c6 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -1,4 +1,5 @@ -import "../../../components/ha-fab"; +import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import "@material/mwc-list/mwc-list-item"; import { mdiCheck, mdiContentDuplicate, @@ -10,8 +11,6 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-input/paper-textarea"; -import "@material/mwc-list/mwc-list-item"; -import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; import { css, CSSResult, @@ -20,19 +19,19 @@ import { LitElement, property, PropertyValues, - TemplateResult, query, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { navigate } from "../../../common/navigate"; +import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-icon-button"; import "../../../components/ha-svg-icon"; import "../../../components/ha-yaml-editor"; -import { showToast } from "../../../util/toast"; import type { HaYamlEditor } from "../../../components/ha-yaml-editor"; -import { copyToClipboard } from "../../../common/util/copy-clipboard"; import { AutomationConfig, AutomationEntity, @@ -50,15 +49,16 @@ import "../../../layouts/hass-tabs-subpage"; import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { showToast } from "../../../util/toast"; import "../ha-config-section"; import { configSections } from "../ha-panel-config"; import "./action/ha-automation-action"; import { HaDeviceAction } from "./action/types/ha-automation-action-device_id"; +import "./blueprint-automation-editor"; import "./condition/ha-automation-condition"; +import "./manual-automation-editor"; import "./trigger/ha-automation-trigger"; import { HaDeviceTrigger } from "./trigger/types/ha-automation-trigger-device"; -import "./manual-automation-editor"; -import "./blueprint-automation-editor"; declare global { interface HTMLElementTagNameMap { diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 616c4b4b2f6f..d6ef6d966734 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -1,6 +1,5 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; -import { mdiPlus, mdiHelpCircle } from "@mdi/js"; +import { mdiHelpCircle, mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { CSSResult, @@ -12,23 +11,24 @@ import { } from "lit-element"; import { ifDefined } from "lit-html/directives/if-defined"; import memoizeOne from "memoize-one"; +import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { formatDateTime } from "../../../common/datetime/format_date_time"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; +import { navigate } from "../../../common/navigate"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; -import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import "../../../components/entity/ha-entity-toggle"; +import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; import { AutomationEntity, triggerAutomation } from "../../../data/automation"; import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import "../../../layouts/hass-tabs-subpage-data-table"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; -import { configSections } from "../ha-panel-config"; import { documentationUrl } from "../../../util/documentation-url"; +import { configSections } from "../ha-panel-config"; import { showNewAutomationDialog } from "./show-dialog-new-automation"; -import { navigate } from "../../../common/navigate"; -import { isComponentLoaded } from "../../../common/config/is_component_loaded"; @customElement("ha-automation-picker") class HaAutomationPicker extends LitElement { diff --git a/src/panels/config/automation/ha-config-automation.ts b/src/panels/config/automation/ha-config-automation.ts index 7b0953d0e5b9..39322da66ee0 100644 --- a/src/panels/config/automation/ha-config-automation.ts +++ b/src/panels/config/automation/ha-config-automation.ts @@ -2,6 +2,7 @@ import { HassEntities } from "home-assistant-js-websocket"; import { customElement, property, PropertyValues } from "lit-element"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; +import { debounce } from "../../../common/util/debounce"; import { AutomationEntity } from "../../../data/automation"; import { HassRouterPage, @@ -10,7 +11,6 @@ import { import { HomeAssistant } from "../../../types"; import "./ha-automation-editor"; import "./ha-automation-picker"; -import { debounce } from "../../../common/util/debounce"; const equal = (a: AutomationEntity[], b: AutomationEntity[]): boolean => { if (a.length !== b.length) { diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index a3ad1219db67..4735e83718bc 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -1,3 +1,8 @@ +import "@material/mwc-button/mwc-button"; +import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; +import "@polymer/paper-input/paper-textarea"; +import { PaperListboxElement } from "@polymer/paper-listbox"; +import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -6,6 +11,9 @@ import { property, } from "lit-element"; import { html } from "lit-html"; +import { fireEvent } from "../../../common/dom/fire_event"; +import "../../../components/entity/ha-entity-toggle"; +import "../../../components/ha-card"; import { Condition, ManualAutomationConfig, @@ -13,21 +21,13 @@ import { triggerAutomation, } from "../../../data/automation"; import { Action, MODES, MODES_MAX } from "../../../data/script"; +import { haStyle } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; import { documentationUrl } from "../../../util/documentation-url"; import "../ha-config-section"; -import "../../../components/ha-card"; -import "@polymer/paper-input/paper-textarea"; -import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; -import "../../../components/entity/ha-entity-toggle"; -import "@material/mwc-button/mwc-button"; -import "./trigger/ha-automation-trigger"; -import "./condition/ha-automation-condition"; import "./action/ha-automation-action"; -import { fireEvent } from "../../../common/dom/fire_event"; -import { PaperListboxElement } from "@polymer/paper-listbox"; -import { haStyle } from "../../../resources/styles"; -import { HassEntity } from "home-assistant-js-websocket"; +import "./condition/ha-automation-condition"; +import "./trigger/ha-automation-trigger"; @customElement("manual-automation-editor") export class HaManualAutomationEditor extends LitElement { diff --git a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts index 1e19024d0bef..5c09ed45cd66 100644 --- a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts +++ b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts @@ -2,27 +2,27 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import "../../../../components/ha-circular-progress"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; +import "../../../../components/ha-circular-progress"; import type { AutomationConfig } from "../../../../data/automation"; import { convertThingTalk } from "../../../../data/cloud"; import type { PolymerChangedEvent } from "../../../../polymer-types"; import { haStyle, haStyleDialog } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; -import type { ThingtalkDialogParams } from "./show-dialog-thingtalk"; import "./ha-thingtalk-placeholders"; import type { PlaceholderValues } from "./ha-thingtalk-placeholders"; +import type { ThingtalkDialogParams } from "./show-dialog-thingtalk"; export interface Placeholder { name: string; diff --git a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts index 52f34a906367..f71d8a8ab927 100644 --- a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts +++ b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -14,6 +14,7 @@ import { fireEvent } from "../../../../common/dom/fire_event"; import { computeDomain } from "../../../../common/entity/compute_domain"; import { applyPatch, getPath } from "../../../../common/util/patch"; import "../../../../components/device/ha-area-devices-picker"; +import "../../../../components/entity/ha-entity-picker"; import { AreaRegistryEntry, subscribeAreaRegistry, @@ -28,7 +29,6 @@ import { SubscribeMixin } from "../../../../mixins/subscribe-mixin"; import { PolymerChangedEvent } from "../../../../polymer-types"; import { haStyleDialog } from "../../../../resources/styles"; import { HomeAssistant } from "../../../../types"; -import "../../../../components/entity/ha-entity-picker"; import { Placeholder, PlaceholderContainer } from "./dialog-thingtalk"; declare global { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts index b5a6af9986a7..4bd1d68f369e 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts @@ -1,22 +1,22 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, } from "lit-element"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-picker"; import "../../../../../components/device/ha-device-trigger-picker"; import "../../../../../components/ha-form/ha-form"; import { deviceAutomationsEqual, + DeviceCapabilities, DeviceTrigger, fetchDeviceTriggerCapabilities, - DeviceCapabilities, } from "../../../../../data/device_automation"; import { HomeAssistant } from "../../../../../types"; -import memoizeOne from "memoize-one"; @customElement("ha-automation-trigger-device") export class HaDeviceTrigger extends LitElement { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts index eed3d63e0f6d..9d53e8ea0e36 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts @@ -1,15 +1,15 @@ import "@polymer/paper-input/paper-input"; import { customElement, LitElement, property } from "lit-element"; import { html } from "lit-html"; -import "../../../../../components/ha-yaml-editor"; import { fireEvent } from "../../../../../common/dom/fire_event"; +import "../../../../../components/ha-yaml-editor"; +import "../../../../../components/user/ha-users-picker"; import { EventTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent, TriggerElement, } from "../ha-automation-trigger-row"; -import "../../../../../components/user/ha-users-picker"; @customElement("ha-automation-trigger-event") export class HaEventTrigger extends LitElement implements TriggerElement { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts index 954e1ef1449d..bd40b48e2152 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts @@ -2,16 +2,16 @@ import "@polymer/paper-input/paper-input"; import { customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, } from "lit-element"; +import { fireEvent } from "../../../../../common/dom/fire_event"; import { TagTrigger } from "../../../../../data/automation"; +import { fetchTags, Tag } from "../../../../../data/tag"; import { HomeAssistant } from "../../../../../types"; import { TriggerElement } from "../ha-automation-trigger-row"; -import { Tag, fetchTags } from "../../../../../data/tag"; -import { fireEvent } from "../../../../../common/dom/fire_event"; @customElement("ha-automation-trigger-tag") export class HaTagTrigger extends LitElement implements TriggerElement { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts index c4aacff1bbaf..5e9483e0c849 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts @@ -1,5 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; import "@polymer/paper-input/paper-textarea"; +import { customElement, html, LitElement, property } from "lit-element"; import { TemplateTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-trigger-row"; diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts index 31f190c2f2c7..c236c333c95a 100644 --- a/src/panels/config/blueprint/dialog-import-blueprint.ts +++ b/src/panels/config/blueprint/dialog-import-blueprint.ts @@ -2,28 +2,28 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import "../../../components/ha-circular-progress"; import { + css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, - css, } from "lit-element"; -import "../../../components/ha-dialog"; -import { haStyleDialog } from "../../../resources/styles"; -import type { HomeAssistant } from "../../../types"; import { fireEvent } from "../../../common/dom/fire_event"; +import "../../../components/ha-circular-progress"; +import "../../../components/ha-dialog"; +import "../../../components/ha-expansion-panel"; import { BlueprintImportResult, importBlueprint, saveBlueprint, } from "../../../data/blueprint"; -import "../../../components/ha-expansion-panel"; +import { haStyleDialog } from "../../../resources/styles"; +import type { HomeAssistant } from "../../../types"; @customElement("ha-dialog-import-blueprint") class DialogImportBlueprint extends LitElement { diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index eb4cdce80919..14f86ca4dacf 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -1,6 +1,5 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; -import { mdiHelpCircle, mdiDelete, mdiRobot, mdiDownload } from "@mdi/js"; +import { mdiDelete, mdiDownload, mdiHelpCircle, mdiRobot } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { CSSResult, @@ -11,26 +10,27 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; +import { fireEvent } from "../../../common/dom/fire_event"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; +import "../../../components/entity/ha-entity-toggle"; +import "../../../components/ha-fab"; +import "../../../components/ha-svg-icon"; +import { showAutomationEditor } from "../../../data/automation"; +import { + BlueprintMetaData, + Blueprints, + deleteBlueprint, +} from "../../../data/blueprint"; import { showAlertDialog, showConfirmationDialog, } from "../../../dialogs/generic/show-dialog-box"; -import "../../../components/entity/ha-entity-toggle"; -import "../../../components/ha-svg-icon"; import "../../../layouts/hass-tabs-subpage-data-table"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; -import { configSections } from "../ha-panel-config"; import { documentationUrl } from "../../../util/documentation-url"; -import { - BlueprintMetaData, - Blueprints, - deleteBlueprint, -} from "../../../data/blueprint"; +import { configSections } from "../ha-panel-config"; import { showAddBlueprintDialog } from "./show-dialog-import-blueprint"; -import { showAutomationEditor } from "../../../data/automation"; -import { fireEvent } from "../../../common/dom/fire_event"; interface BlueprintMetaDataPath extends BlueprintMetaData { path: string; diff --git a/src/panels/config/blueprint/ha-config-blueprint.ts b/src/panels/config/blueprint/ha-config-blueprint.ts index 12e3bbc35f19..efe7e8264587 100644 --- a/src/panels/config/blueprint/ha-config-blueprint.ts +++ b/src/panels/config/blueprint/ha-config-blueprint.ts @@ -1,11 +1,11 @@ import { customElement, property, PropertyValues } from "lit-element"; +import { Blueprints, fetchBlueprints } from "../../../data/blueprint"; import { HassRouterPage, RouterOptions, } from "../../../layouts/hass-router-page"; -import "./ha-blueprint-overview"; import { HomeAssistant } from "../../../types"; -import { Blueprints, fetchBlueprints } from "../../../data/blueprint"; +import "./ha-blueprint-overview"; declare global { // for fire event diff --git a/src/panels/config/cloud/account/cloud-account.js b/src/panels/config/cloud/account/cloud-account.js index 2359d2406779..8c1b390e3801 100644 --- a/src/panels/config/cloud/account/cloud-account.js +++ b/src/panels/config/cloud/account/cloud-account.js @@ -4,13 +4,13 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { formatDateTime } from "../../../../common/datetime/format_date_time"; +import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import "../../../../components/buttons/ha-call-api-button"; import "../../../../components/ha-card"; import { fetchCloudSubscriptionInfo } from "../../../../data/cloud"; import "../../../../layouts/hass-subpage"; import { EventsMixin } from "../../../../mixins/events-mixin"; import LocalizeMixin from "../../../../mixins/localize-mixin"; -import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import "../../../../styles/polymer-ha-style"; import "../../ha-config-section"; import "./cloud-alexa-pref"; diff --git a/src/panels/config/cloud/account/cloud-alexa-pref.ts b/src/panels/config/cloud/account/cloud-alexa-pref.ts index f8753c34d43e..a49c41279d10 100644 --- a/src/panels/config/cloud/account/cloud-alexa-pref.ts +++ b/src/panels/config/cloud/account/cloud-alexa-pref.ts @@ -3,9 +3,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; diff --git a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts index 9357e45c757f..3a1c744c41b2 100644 --- a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts +++ b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts @@ -6,8 +6,8 @@ import { css, CSSResult, html, - LitElement, internalProperty, + LitElement, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog"; diff --git a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts index e0ad918fe519..7dd4b18354cf 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -237,7 +237,7 @@ class CloudGoogleAssistant extends LitElement { } return html` - ${ diff --git a/src/panels/config/cloud/ha-config-cloud.ts b/src/panels/config/cloud/ha-config-cloud.ts index d8b512e39ea1..c62aa80cb37a 100644 --- a/src/panels/config/cloud/ha-config-cloud.ts +++ b/src/panels/config/cloud/ha-config-cloud.ts @@ -1,5 +1,5 @@ import { PolymerElement } from "@polymer/polymer"; -import { customElement, property, internalProperty } from "lit-element"; +import { customElement, internalProperty, property } from "lit-element"; import { navigate } from "../../../common/navigate"; import { CloudStatus } from "../../../data/cloud"; import { diff --git a/src/panels/config/cloud/login/cloud-login.js b/src/panels/config/cloud/login/cloud-login.js index f2cdeb335099..bc69bc376c25 100644 --- a/src/panels/config/cloud/login/cloud-login.js +++ b/src/panels/config/cloud/login/cloud-login.js @@ -1,5 +1,4 @@ import "@material/mwc-button"; -import "../../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -7,8 +6,10 @@ import "@polymer/paper-ripple/paper-ripple"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; +import { computeRTL } from "../../../../common/util/compute_rtl"; import "../../../../components/buttons/ha-progress-button"; import "../../../../components/ha-card"; +import "../../../../components/ha-icon-button"; import "../../../../components/ha-icon-next"; import "../../../../layouts/hass-subpage"; import { EventsMixin } from "../../../../mixins/events-mixin"; @@ -16,7 +17,6 @@ import LocalizeMixin from "../../../../mixins/localize-mixin"; import NavigateMixin from "../../../../mixins/navigate-mixin"; import "../../../../styles/polymer-ha-style"; import "../../ha-config-section"; -import { computeRTL } from "../../../../common/util/compute_rtl"; /* * @appliesMixin NavigateMixin diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index 6cb04f669233..406ca0d00b5a 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -8,9 +8,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { UNIT_C } from "../../../common/const"; diff --git a/src/panels/config/core/ha-config-core.js b/src/panels/config/core/ha-config-core.js index 75d59b5aa594..5b41675898d4 100644 --- a/src/panels/config/core/ha-config-core.js +++ b/src/panels/config/core/ha-config-core.js @@ -1,9 +1,9 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import "../../../components/ha-icon-button"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; +import "../../../components/ha-icon-button"; import "../../../layouts/hass-tabs-subpage"; import LocalizeMixin from "../../../mixins/localize-mixin"; import "../../../styles/polymer-ha-style"; diff --git a/src/panels/config/core/ha-config-name-form.ts b/src/panels/config/core/ha-config-name-form.ts index d8315c6104ab..d29cba9d8b4c 100644 --- a/src/panels/config/core/ha-config-name-form.ts +++ b/src/panels/config/core/ha-config-name-form.ts @@ -6,9 +6,9 @@ import "@polymer/paper-radio-group/paper-radio-group"; import { customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-card"; diff --git a/src/panels/config/core/ha-config-section-core.js b/src/panels/config/core/ha-config-section-core.js index 63888c047d8c..d91dda88f153 100644 --- a/src/panels/config/core/ha-config-section-core.js +++ b/src/panels/config/core/ha-config-section-core.js @@ -3,7 +3,6 @@ import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/buttons/ha-call-service-button"; import "../../../components/ha-card"; import LocalizeMixin from "../../../mixins/localize-mixin"; diff --git a/src/panels/config/core/ha-config-url-form.ts b/src/panels/config/core/ha-config-url-form.ts index e63b256e0c20..549ccfa4d014 100644 --- a/src/panels/config/core/ha-config-url-form.ts +++ b/src/panels/config/core/ha-config-url-form.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../components/ha-card"; diff --git a/src/panels/config/customize/ha-config-customize.js b/src/panels/config/customize/ha-config-customize.js index fe0c1f898b2c..d9fa1d6e4356 100644 --- a/src/panels/config/customize/ha-config-customize.js +++ b/src/panels/config/customize/ha-config-customize.js @@ -7,11 +7,11 @@ import { sortStatesByName } from "../../../common/entity/states_sort_by_name"; import "../../../layouts/hass-tabs-subpage"; import LocalizeMixin from "../../../mixins/localize-mixin"; import "../../../styles/polymer-ha-style"; +import { documentationUrl } from "../../../util/documentation-url"; import "../ha-config-section"; import "../ha-entity-config"; import { configSections } from "../ha-panel-config"; import "./ha-form-customize"; -import { documentationUrl } from "../../../util/documentation-url"; /* * @appliesMixin LocalizeMixin diff --git a/src/panels/config/customize/ha-customize-attribute.js b/src/panels/config/customize/ha-customize-attribute.js index 634e083f63a9..d47bb42ce571 100644 --- a/src/panels/config/customize/ha-customize-attribute.js +++ b/src/panels/config/customize/ha-customize-attribute.js @@ -1,7 +1,7 @@ -import "../../../components/ha-icon-button"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; +import "../../../components/ha-icon-button"; import hassAttributeUtil from "../../../util/hass-attributes-util"; import "../ha-form-style"; import "./types/ha-customize-array"; diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 7c7466704cd1..b6dfd0bfc125 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -1,4 +1,4 @@ -import "../../../layouts/ha-app-layout"; +import { mdiCloudLock } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { @@ -13,15 +13,15 @@ import { import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-card"; import "../../../components/ha-icon-next"; -import "../../../components/ha-svg-icon"; import "../../../components/ha-menu-button"; +import "../../../components/ha-svg-icon"; import { CloudStatus } from "../../../data/cloud"; +import "../../../layouts/ha-app-layout"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; import "../ha-config-section"; import { configSections } from "../ha-panel-config"; import "./ha-config-navigation"; -import { mdiCloudLock } from "@mdi/js"; @customElement("ha-config-dashboard") class HaConfigDashboard extends LitElement { diff --git a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts index a7a9b2a661a4..20b24e733172 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts @@ -2,9 +2,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../../components/ha-dialog"; diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index 9f74efeef242..08feb988363b 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -17,12 +17,12 @@ import "../../../../components/entity/state-badge"; import "../../../../components/ha-card"; import "../../../../components/ha-icon"; import { HomeAssistant } from "../../../../types"; +import { HuiErrorCard } from "../../../lovelace/cards/hui-error-card"; import { createRowElement } from "../../../lovelace/create-element/create-row-element"; import { addEntitiesToLovelaceView } from "../../../lovelace/editor/add-entities-to-view"; import { LovelaceRow } from "../../../lovelace/entity-rows/types"; import { showEntityEditorDialog } from "../../entities/show-dialog-entity-editor"; import { EntityRegistryStateEntry } from "../ha-config-device-page"; -import { HuiErrorCard } from "../../../lovelace/cards/hui-error-card"; @customElement("ha-device-entities-card") export class HaDeviceEntitiesCard extends LitElement { diff --git a/src/panels/config/devices/device-detail/ha-device-info-card.ts b/src/panels/config/devices/device-detail/ha-device-info-card.ts index 5e4de8859e4f..4748a5069987 100644 --- a/src/panels/config/devices/device-detail/ha-device-info-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-info-card.ts @@ -12,8 +12,8 @@ import { computeDeviceName, DeviceRegistryEntry, } from "../../../../data/device_registry"; -import { loadDeviceRegistryDetailDialog } from "../device-registry-detail/show-dialog-device-registry-detail"; import { HomeAssistant } from "../../../../types"; +import { loadDeviceRegistryDetailDialog } from "../device-registry-detail/show-dialog-device-registry-detail"; @customElement("ha-device-info-card") export class HaDeviceCard extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index c7173c1a8bc7..d66d7367794c 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -4,14 +4,15 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import { computeStateName } from "../../../../../../common/entity/compute_state_name"; +import { computeRTLDirection } from "../../../../../../common/util/compute_rtl"; import "../../../../../../components/ha-dialog"; -import "../../../../../../components/ha-switch"; import "../../../../../../components/ha-formfield"; +import "../../../../../../components/ha-switch"; import type { HaSwitch } from "../../../../../../components/ha-switch"; import { computeDeviceName } from "../../../../../../data/device_registry"; import { @@ -23,7 +24,6 @@ import { HomeAssistant } from "../../../../../../types"; import "./mqtt-discovery-payload"; import "./mqtt-messages"; import { MQTTDeviceDebugInfoDialogParams } from "./show-dialog-mqtt-device-debug-info"; -import { computeRTLDirection } from "../../../../../../common/util/compute_rtl"; @customElement("dialog-mqtt-device-debug-info") class DialogMQTTDeviceDebugInfo extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts index fcdd9bce0ce0..64d9d7c967b5 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts @@ -1,18 +1,18 @@ import { + css, CSSResult, customElement, html, LitElement, property, TemplateResult, - css, } from "lit-element"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { removeMQTTDeviceEntry } from "../../../../../../data/mqtt"; import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-dialog-box"; -import { showMQTTDeviceDebugInfoDialog } from "./show-dialog-mqtt-device-debug-info"; import { haStyle } from "../../../../../../resources/styles"; import { HomeAssistant } from "../../../../../../types"; +import { showMQTTDeviceDebugInfoDialog } from "./show-dialog-mqtt-device-debug-info"; @customElement("ha-device-actions-mqtt") export class HaDeviceActionsMqtt extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts index 4adc5610077c..1a9c0eb59196 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index 7d036b03fbcc..de55b224bd1d 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -4,15 +4,15 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { formatTimeWithSeconds } from "../../../../../../common/datetime/format_time"; -import { HomeAssistant } from "../../../../../../types"; import { MQTTMessage } from "../../../../../../data/mqtt"; +import { HomeAssistant } from "../../../../../../types"; @customElement("mqtt-messages") class MQTTMessages extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts index 6773c324a9e0..82f770c92883 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts @@ -1,23 +1,23 @@ +import "@material/mwc-button/mwc-button"; import { + css, CSSResult, customElement, html, LitElement, property, - TemplateResult, - css, PropertyValues, + TemplateResult, } from "lit-element"; +import { navigate } from "../../../../../../common/navigate"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; -import { haStyle } from "../../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../../types"; import { getIdentifiersFromDevice, OZWNodeIdentifiers, } from "../../../../../../data/ozw"; +import { haStyle } from "../../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../../types"; import { showOZWRefreshNodeDialog } from "../../../../integrations/integration-panels/ozw/show-dialog-ozw-refresh-node"; -import { navigate } from "../../../../../../common/navigate"; -import "@material/mwc-button/mwc-button"; @customElement("ha-device-actions-ozw") export class HaDeviceActionsOzw extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts index ce639c75b82b..f23ce1c6360a 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts @@ -1,23 +1,23 @@ import { + css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, - css, PropertyValues, + TemplateResult, } from "lit-element"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; -import { haStyle } from "../../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../../types"; import { - OZWDevice, fetchOZWNodeStatus, getIdentifiersFromDevice, + OZWDevice, OZWNodeIdentifiers, } from "../../../../../../data/ozw"; +import { haStyle } from "../../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../../types"; @customElement("ha-device-info-ozw") export class HaDeviceInfoOzw extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts index c83d785fdd7d..96253e2bd99b 100644 --- a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts +++ b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts @@ -1,11 +1,11 @@ import { + css, CSSResult, customElement, html, LitElement, property, TemplateResult, - css, } from "lit-element"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { removeTasmotaDeviceEntry } from "../../../../../../data/tasmota"; diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index 96d9ffa4db01..40e6c7e79c84 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -1,26 +1,26 @@ import { + css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, - css, PropertyValues, + TemplateResult, } from "lit-element"; +import { navigate } from "../../../../../../common/navigate"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; -import { haStyle } from "../../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../../types"; import { - ZHADevice, fetchZHADevice, reconfigureNode, + ZHADevice, } from "../../../../../../data/zha"; -import { navigate } from "../../../../../../common/navigate"; -import { showZHADeviceZigbeeInfoDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-device-zigbee-info"; import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-dialog-box"; +import { haStyle } from "../../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../../types"; import { showZHAClusterDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-cluster"; +import { showZHADeviceZigbeeInfoDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-device-zigbee-info"; @customElement("ha-device-actions-zha") export class HaDeviceActionsZha extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts index 3005838eb447..5440940f164b 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts @@ -1,18 +1,18 @@ import { + css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, - css, PropertyValues, + TemplateResult, } from "lit-element"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; +import { fetchZHADevice, ZHADevice } from "../../../../../../data/zha"; import { haStyle } from "../../../../../../resources/styles"; import { HomeAssistant } from "../../../../../../types"; -import { ZHADevice, fetchZHADevice } from "../../../../../../data/zha"; import { formatAsPaddedHex } from "../../../../integrations/integration-panels/zha/functions"; @customElement("ha-device-info-zha") diff --git a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts index 4fd6abcb7c41..c30d63b50e70 100644 --- a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts +++ b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts @@ -3,27 +3,25 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import "../../../../components/ha-dialog"; -import "../../../../components/ha-area-picker"; - import { - CSSResult, - LitElement, - TemplateResult, css, + CSSResult, customElement, html, internalProperty, + LitElement, property, + TemplateResult, } from "lit-element"; - -import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry-detail"; -import { HomeAssistant } from "../../../../types"; +import { fireEvent } from "../../../../common/dom/fire_event"; +import "../../../../components/ha-area-picker"; +import "../../../../components/ha-dialog"; import type { HaSwitch } from "../../../../components/ha-switch"; -import { PolymerChangedEvent } from "../../../../polymer-types"; import { computeDeviceName } from "../../../../data/device_registry"; -import { fireEvent } from "../../../../common/dom/fire_event"; +import { PolymerChangedEvent } from "../../../../polymer-types"; import { haStyle, haStyleDialog } from "../../../../resources/styles"; +import { HomeAssistant } from "../../../../types"; +import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry-detail"; @customElement("dialog-device-registry-detail") class DialogDeviceRegistryDetail extends LitElement { diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 51f063821729..9f6a90748bb5 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -32,21 +32,21 @@ import { } from "../../../data/entity_registry"; import { SceneEntities, showSceneEditor } from "../../../data/scene"; import { findRelated, RelatedResult } from "../../../data/search"; -import { - loadDeviceRegistryDetailDialog, - showDeviceRegistryDetailDialog, -} from "./device-registry-detail/show-dialog-device-registry-detail"; import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; import "../../../layouts/hass-error-screen"; import "../../../layouts/hass-tabs-subpage"; +import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { brandsUrl } from "../../../util/brands-url"; import "../ha-config-section"; import { configSections } from "../ha-panel-config"; import "./device-detail/ha-device-entities-card"; import "./device-detail/ha-device-info-card"; import { showDeviceAutomationDialog } from "./device-detail/show-dialog-device-automation"; -import { brandsUrl } from "../../../util/brands-url"; -import { haStyle } from "../../../resources/styles"; +import { + loadDeviceRegistryDetailDialog, + showDeviceRegistryDetailDialog, +} from "./device-registry-detail/show-dialog-device-registry-detail"; export interface EntityRegistryStateEntry extends EntityRegistryEntry { stateName?: string | null; diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 3eba91db7bc8..ca82762c01b9 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -1,5 +1,6 @@ -import { mdiPlus, mdiFilterVariant, mdiCancel } from "@mdi/js"; import "@material/mwc-list/mwc-list-item"; +import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; +import { mdiCancel, mdiFilterVariant, mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, @@ -13,7 +14,6 @@ import { } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import memoizeOne from "memoize-one"; -import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import { HASSDomEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; import { LocalizeFunc } from "../../../common/translations/localize"; @@ -39,9 +39,9 @@ import { } from "../../../data/entity_registry"; import { domainToName } from "../../../data/integration"; import "../../../layouts/hass-tabs-subpage-data-table"; +import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; import { configSections } from "../ha-panel-config"; -import { haStyle } from "../../../resources/styles"; interface DeviceRowData extends DeviceRegistryEntry { device?: DeviceRowData; diff --git a/src/panels/config/devices/ha-config-devices.ts b/src/panels/config/devices/ha-config-devices.ts index bfdcc55754bb..82dd2d7720b2 100644 --- a/src/panels/config/devices/ha-config-devices.ts +++ b/src/panels/config/devices/ha-config-devices.ts @@ -1,8 +1,8 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { customElement, - property, internalProperty, + property, PropertyValues, } from "lit-element"; import { diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index 441edbfa9877..3acd56bcadee 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -27,8 +27,8 @@ import { getExtendedEntityRegistryEntry, } from "../../../data/entity_registry"; import { haStyleDialog } from "../../../resources/styles"; -import { documentationUrl } from "../../../util/documentation-url"; import type { HomeAssistant } from "../../../types"; +import { documentationUrl } from "../../../util/documentation-url"; import { PLATFORMS_WITH_SETTINGS_TAB } from "./const"; import "./entity-registry-settings"; import type { EntityRegistryDetailDialogParams } from "./show-dialog-entity-editor"; diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index 8f7ecfff2fee..b807179d73d3 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, query, TemplateResult, @@ -13,6 +13,11 @@ import { import { isComponentLoaded } from "../../../../../common/config/is_component_loaded"; import { dynamicElement } from "../../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../../common/dom/fire_event"; +import { + deleteCounter, + fetchCounter, + updateCounter, +} from "../../../../../data/counter"; import { ExtEntityRegistryEntry, removeEntityRegistryEntry, @@ -42,29 +47,24 @@ import { fetchInputText, updateInputText, } from "../../../../../data/input_text"; -import { - deleteCounter, - fetchCounter, - updateCounter, -} from "../../../../../data/counter"; import { deleteTimer, fetchTimer, updateTimer, } from "../../../../../data/timer"; import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dialog-box"; +import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant } from "../../../../../types"; import type { Helper } from "../../../helpers/const"; +import "../../../helpers/forms/ha-counter-form"; import "../../../helpers/forms/ha-input_boolean-form"; import "../../../helpers/forms/ha-input_datetime-form"; import "../../../helpers/forms/ha-input_number-form"; import "../../../helpers/forms/ha-input_select-form"; import "../../../helpers/forms/ha-input_text-form"; -import "../../../helpers/forms/ha-counter-form"; import "../../../helpers/forms/ha-timer-form"; import "../../entity-registry-basic-editor"; import type { HaEntityRegistryBasicEditor } from "../../entity-registry-basic-editor"; -import { haStyle } from "../../../../../resources/styles"; const HELPERS = { input_boolean: { diff --git a/src/panels/config/entities/entity-registry-basic-editor.ts b/src/panels/config/entities/entity-registry-basic-editor.ts index f40044f1b0bc..1b1690394caf 100644 --- a/src/panels/config/entities/entity-registry-basic-editor.ts +++ b/src/panels/config/entities/entity-registry-basic-editor.ts @@ -1,32 +1,32 @@ import "@polymer/paper-input/paper-input"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { computeDomain } from "../../../common/entity/compute_domain"; +import "../../../components/ha-area-picker"; import "../../../components/ha-switch"; import type { HaSwitch } from "../../../components/ha-switch"; +import { + DeviceRegistryEntry, + subscribeDeviceRegistry, +} from "../../../data/device_registry"; import { EntityRegistryEntryUpdateParams, ExtEntityRegistryEntry, updateEntityRegistryEntry, } from "../../../data/entity_registry"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; +import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import type { PolymerChangedEvent } from "../../../polymer-types"; import type { HomeAssistant } from "../../../types"; -import "../../../components/ha-area-picker"; -import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - DeviceRegistryEntry, - subscribeDeviceRegistry, -} from "../../../data/device_registry"; -import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; @customElement("ha-registry-basic-editor") export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index be22a7ebaf33..81187ab27b4c 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -6,17 +6,25 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; +import { domainIcon } from "../../../common/entity/domain_icon"; +import "../../../components/ha-area-picker"; +import "../../../components/ha-expansion-panel"; import "../../../components/ha-icon-input"; import "../../../components/ha-switch"; import type { HaSwitch } from "../../../components/ha-switch"; +import { + DeviceRegistryEntry, + subscribeDeviceRegistry, + updateDeviceRegistryEntry, +} from "../../../data/device_registry"; import { EntityRegistryEntryUpdateParams, ExtEntityRegistryEntry, @@ -27,18 +35,10 @@ import { showAlertDialog, showConfirmationDialog, } from "../../../dialogs/generic/show-dialog-box"; +import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import type { PolymerChangedEvent } from "../../../polymer-types"; import { haStyle } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; -import { domainIcon } from "../../../common/entity/domain_icon"; -import "../../../components/ha-area-picker"; -import { - DeviceRegistryEntry, - subscribeDeviceRegistry, - updateDeviceRegistryEntry, -} from "../../../data/device_registry"; -import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; -import "../../../components/ha-expansion-panel"; import { showDeviceRegistryDetailDialog } from "../devices/device-registry-detail/show-dialog-device-registry-detail"; @customElement("entity-registry-settings") diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index b8436d1b7495..356b38e2eb3a 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -29,6 +29,7 @@ import { stateIcon } from "../../../common/entity/state_icon"; import { navigate } from "../../../common/navigate"; import "../../../common/search/search-input"; import { LocalizeFunc } from "../../../common/translations/localize"; +import { computeRTL } from "../../../common/util/compute_rtl"; import type { DataTableColumnContainer, RowClickedEvent, @@ -36,7 +37,16 @@ import type { } from "../../../components/data-table/ha-data-table"; import "../../../components/ha-button-menu"; import "../../../components/ha-icon"; +import { + AreaRegistryEntry, + subscribeAreaRegistry, +} from "../../../data/area_registry"; import { ConfigEntry, getConfigEntries } from "../../../data/config_entries"; +import { + DeviceRegistryEntry, + subscribeDeviceRegistry, +} from "../../../data/device_registry"; +import { UNAVAILABLE } from "../../../data/entity"; import { computeEntityRegistryName, EntityRegistryEntry, @@ -53,6 +63,7 @@ import "../../../layouts/hass-loading-screen"; import "../../../layouts/hass-tabs-subpage-data-table"; import type { HaTabsSubpageDataTable } from "../../../layouts/hass-tabs-subpage-data-table"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; +import { haStyle } from "../../../resources/styles"; import type { HomeAssistant, Route } from "../../../types"; import { configSections } from "../ha-panel-config"; import { DialogEntityEditor } from "./dialog-entity-editor"; @@ -60,17 +71,6 @@ import { loadEntityEditorDialog, showEntityEditorDialog, } from "./show-dialog-entity-editor"; -import { haStyle } from "../../../resources/styles"; -import { UNAVAILABLE } from "../../../data/entity"; -import { - DeviceRegistryEntry, - subscribeDeviceRegistry, -} from "../../../data/device_registry"; -import { - AreaRegistryEntry, - subscribeAreaRegistry, -} from "../../../data/area_registry"; -import { computeRTL } from "../../../common/util/compute_rtl"; export interface StateEntity extends EntityRegistryEntry { readonly?: boolean; diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 25a4adf551e4..3d9a829c6a7a 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -1,10 +1,31 @@ +import { + mdiAccount, + mdiBadgeAccountHorizontal, + mdiDevices, + mdiHomeAssistant, + mdiInformation, + mdiMapMarkerRadius, + mdiMathLog, + mdiNfcVariant, + mdiPalette, + mdiPaletteSwatch, + mdiPencil, + mdiPuzzle, + mdiRobot, + mdiScriptText, + mdiServer, + mdiShape, + mdiSofa, + mdiTools, + mdiViewDashboard, +} from "@mdi/js"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { PolymerElement } from "@polymer/polymer"; import { customElement, - property, internalProperty, + property, PropertyValues, } from "lit-element"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; @@ -14,27 +35,6 @@ import "../../layouts/hass-loading-screen"; import { HassRouterPage, RouterOptions } from "../../layouts/hass-router-page"; import { PageNavigation } from "../../layouts/hass-tabs-subpage"; import { HomeAssistant, Route } from "../../types"; -import { - mdiPuzzle, - mdiDevices, - mdiShape, - mdiSofa, - mdiRobot, - mdiPalette, - mdiScriptText, - mdiTools, - mdiViewDashboard, - mdiAccount, - mdiMapMarkerRadius, - mdiBadgeAccountHorizontal, - mdiHomeAssistant, - mdiServer, - mdiInformation, - mdiMathLog, - mdiPencil, - mdiNfcVariant, - mdiPaletteSwatch, -} from "@mdi/js"; declare global { // for fire event diff --git a/src/panels/config/helpers/const.ts b/src/panels/config/helpers/const.ts index 5835f63c28cc..711533835157 100644 --- a/src/panels/config/helpers/const.ts +++ b/src/panels/config/helpers/const.ts @@ -1,9 +1,9 @@ +import { Counter } from "../../../data/counter"; import { InputBoolean } from "../../../data/input_boolean"; import { InputDateTime } from "../../../data/input_datetime"; import { InputNumber } from "../../../data/input_number"; import { InputSelect } from "../../../data/input_select"; import { InputText } from "../../../data/input_text"; -import { Counter } from "../../../data/counter"; import { Timer } from "../../../data/timer"; export const HELPER_DOMAINS = [ diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index 8a314af8d7cd..b4eeed86bef9 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -17,22 +17,22 @@ import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { dynamicElement } from "../../../common/dom/dynamic-element-directive"; import { domainIcon } from "../../../common/entity/domain_icon"; import "../../../components/ha-dialog"; +import { createCounter } from "../../../data/counter"; import { createInputBoolean } from "../../../data/input_boolean"; import { createInputDateTime } from "../../../data/input_datetime"; import { createInputNumber } from "../../../data/input_number"; import { createInputSelect } from "../../../data/input_select"; import { createInputText } from "../../../data/input_text"; -import { createCounter } from "../../../data/counter"; import { createTimer } from "../../../data/timer"; import { haStyleDialog } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; import { Helper } from "./const"; +import "./forms/ha-counter-form"; import "./forms/ha-input_boolean-form"; import "./forms/ha-input_datetime-form"; import "./forms/ha-input_number-form"; import "./forms/ha-input_select-form"; import "./forms/ha-input_text-form"; -import "./forms/ha-counter-form"; import "./forms/ha-timer-form"; const HELPERS = { diff --git a/src/panels/config/helpers/forms/ha-input_boolean-form.ts b/src/panels/config/helpers/forms/ha-input_boolean-form.ts index 54b1fa2b3ad7..90656b861d35 100644 --- a/src/panels/config/helpers/forms/ha-input_boolean-form.ts +++ b/src/panels/config/helpers/forms/ha-input_boolean-form.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; diff --git a/src/panels/config/helpers/forms/ha-input_datetime-form.ts b/src/panels/config/helpers/forms/ha-input_datetime-form.ts index 07dfb95eb97f..09a1efc4e7a7 100644 --- a/src/panels/config/helpers/forms/ha-input_datetime-form.ts +++ b/src/panels/config/helpers/forms/ha-input_datetime-form.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; diff --git a/src/panels/config/helpers/forms/ha-input_select-form.ts b/src/panels/config/helpers/forms/ha-input_select-form.ts index 657df0282668..46a59bc3d1a0 100644 --- a/src/panels/config/helpers/forms/ha-input_select-form.ts +++ b/src/panels/config/helpers/forms/ha-input_select-form.ts @@ -1,5 +1,4 @@ import "@material/mwc-button/mwc-button"; -import "../../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; @@ -9,13 +8,14 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; +import "../../../../components/ha-icon-button"; import "../../../../components/ha-icon-input"; import type { InputSelect } from "../../../../data/input_select"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/helpers/forms/ha-input_text-form.ts b/src/panels/config/helpers/forms/ha-input_text-form.ts index 98db37b536b2..5c738b9dd879 100644 --- a/src/panels/config/helpers/forms/ha-input_text-form.ts +++ b/src/panels/config/helpers/forms/ha-input_text-form.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; diff --git a/src/panels/config/helpers/forms/ha-timer-form.ts b/src/panels/config/helpers/forms/ha-timer-form.ts index 9757b76b94ff..1b81f2d481f9 100644 --- a/src/panels/config/helpers/forms/ha-timer-form.ts +++ b/src/panels/config/helpers/forms/ha-timer-form.ts @@ -3,14 +3,14 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; -import { Timer, DurationDict } from "../../../../data/timer"; +import { DurationDict, Timer } from "../../../../data/timer"; import { haStyle } from "../../../../resources/styles"; import { HomeAssistant } from "../../../../types"; diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index d22a37da259b..8262e9bcb7f5 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; @@ -23,6 +22,7 @@ import { DataTableColumnContainer, RowClickedEvent, } from "../../../components/data-table/ha-data-table"; +import "../../../components/ha-fab"; import "../../../components/ha-icon"; import "../../../components/ha-svg-icon"; import "../../../layouts/hass-loading-screen"; diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index d527c7868bde..c1dd606e5737 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -6,13 +6,13 @@ import { property, TemplateResult, } from "lit-element"; +import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { documentationUrl } from "../../../util/documentation-url"; +import { configSections } from "../ha-panel-config"; import "./integrations-card"; import "./system-health-card"; -import { configSections } from "../ha-panel-config"; -import "../../../layouts/hass-tabs-subpage"; -import { documentationUrl } from "../../../util/documentation-url"; const JS_TYPE = __BUILD__; const JS_VERSION = __VERSION__; diff --git a/src/panels/config/info/integrations-card.ts b/src/panels/config/info/integrations-card.ts index f10b106c2294..b7e10b3e24ce 100644 --- a/src/panels/config/info/integrations-card.ts +++ b/src/panels/config/info/integrations-card.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index d448668b461c..ee5bd6ebd832 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; import "@material/mwc-list/mwc-list-item"; import { mdiDotsVertical, mdiPlus } from "@mdi/js"; @@ -25,6 +24,7 @@ import { LocalizeFunc } from "../../../common/translations/localize"; import { nextRender } from "../../../common/util/render-status"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; import { ConfigEntry, @@ -60,6 +60,7 @@ import "../../../layouts/hass-tabs-subpage"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { brandsUrl } from "../../../util/brands-url"; import { configSections } from "../ha-panel-config"; import "./ha-integration-card"; import type { @@ -67,7 +68,6 @@ import type { ConfigEntryUpdatedEvent, HaIntegrationCard, } from "./ha-integration-card"; -import { brandsUrl } from "../../../util/brands-url"; interface DataEntryFlowProgressExtended extends DataEntryFlowProgress { localized_title?: string; diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 31ab7e5e8797..9d9a10153811 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -1,37 +1,37 @@ +import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; +import { mdiDotsVertical, mdiOpenInNew } from "@mdi/js"; import { + css, + CSSResult, customElement, + html, LitElement, property, - html, - CSSResult, - css, TemplateResult, } from "lit-element"; -import { HomeAssistant } from "../../../types"; -import { ConfigEntryExtended } from "./ha-config-integrations"; -import { domainToName, IntegrationManifest } from "../../../data/integration"; +import { fireEvent } from "../../../common/dom/fire_event"; +import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event"; +import "../../../components/ha-icon-next"; import { ConfigEntry, - updateConfigEntry, deleteConfigEntry, reloadConfigEntry, + updateConfigEntry, } from "../../../data/config_entries"; -import { EntityRegistryEntry } from "../../../data/entity_registry"; import { DeviceRegistryEntry } from "../../../data/device_registry"; -import { showOptionsFlowDialog } from "../../../dialogs/config-flow/show-dialog-options-flow"; +import { EntityRegistryEntry } from "../../../data/entity_registry"; +import { domainToName, IntegrationManifest } from "../../../data/integration"; import { showConfigEntrySystemOptionsDialog } from "../../../dialogs/config-entry-system-options/show-dialog-config-entry-system-options"; +import { showOptionsFlowDialog } from "../../../dialogs/config-flow/show-dialog-options-flow"; import { - showPromptDialog, - showConfirmationDialog, showAlertDialog, + showConfirmationDialog, + showPromptDialog, } from "../../../dialogs/generic/show-dialog-box"; import { haStyle } from "../../../resources/styles"; -import "../../../components/ha-icon-next"; -import { fireEvent } from "../../../common/dom/fire_event"; -import { mdiDotsVertical, mdiOpenInNew } from "@mdi/js"; -import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; -import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event"; +import { HomeAssistant } from "../../../types"; import { brandsUrl } from "../../../util/brands-url"; +import { ConfigEntryExtended } from "./ha-config-integrations"; export interface ConfigEntryUpdatedEvent { entry: ConfigEntry; diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index eefacaf40c5b..1df1f36d0820 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -5,19 +5,19 @@ import { CSSResultArray, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/ha-card"; import "../../../../../components/ha-code-editor"; +import { getConfigEntries } from "../../../../../data/config_entries"; +import { showOptionsFlowDialog } from "../../../../../dialogs/config-flow/show-dialog-options-flow"; +import "../../../../../layouts/hass-subpage"; import { haStyle } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; import "./mqtt-subscribe-card"; -import "../../../../../layouts/hass-subpage"; -import { showOptionsFlowDialog } from "../../../../../dialogs/config-flow/show-dialog-options-flow"; -import { getConfigEntries } from "../../../../../data/config_entries"; @customElement("mqtt-config-panel") class HaPanelDevMqtt extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index 194a96e33dd4..8818169cfb3f 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -5,9 +5,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { formatTime } from "../../../../../common/datetime/format_time"; diff --git a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts index 6f86fbc7bc44..f041c1c37075 100644 --- a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts +++ b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts @@ -1,27 +1,26 @@ import { + css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, PropertyValues, - css, + TemplateResult, } from "lit-element"; -import "../../../../../components/ha-code-editor"; import "../../../../../components/ha-circular-progress"; +import "../../../../../components/ha-code-editor"; import { createCloseHeading } from "../../../../../components/ha-dialog"; -import { haStyleDialog } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; -import { OZWRefreshNodeDialogParams } from "./show-dialog-ozw-refresh-node"; - import { fetchOZWNodeMetadata, - OZWDeviceMetaData, - OZWDevice, nodeQueryStages, + OZWDevice, + OZWDeviceMetaData, } from "../../../../../data/ozw"; +import { haStyleDialog } from "../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../types"; +import { OZWRefreshNodeDialogParams } from "./show-dialog-ozw-refresh-node"; @customElement("dialog-ozw-refresh-node") class DialogOZWRefreshNode extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts index f99c451ca4c5..dba134523b85 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts @@ -22,13 +22,13 @@ import { networkStartingStatuses, OZWInstance, } from "../../../../../data/ozw"; +import "../../../../../layouts/hass-error-screen"; +import "../../../../../layouts/hass-loading-screen"; import "../../../../../layouts/hass-tabs-subpage"; import type { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant, Route } from "../../../../../types"; import "../../../ha-config-section"; -import "../../../../../layouts/hass-error-screen"; -import "../../../../../layouts/hass-loading-screen"; export const ozwTabs: PageNavigation[] = []; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts index 4f6128ea6b42..b2799292d753 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts @@ -1,12 +1,12 @@ +import { mdiNetwork, mdiServerNetwork } from "@mdi/js"; import { customElement, property } from "lit-element"; import { HassRouterPage, RouterOptions, } from "../../../../../layouts/hass-router-page"; +import { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; import { HomeAssistant } from "../../../../../types"; import { computeTail } from "./ozw-config-router"; -import { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; -import { mdiServerNetwork, mdiNetwork } from "@mdi/js"; export const ozwNetworkTabs = (instance: number): PageNavigation[] => { return [ diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts index 3cb884f0d7d5..c7d9bee401f6 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts @@ -4,8 +4,8 @@ import { CSSResultArray, customElement, html, - LitElement, internalProperty, + LitElement, property, TemplateResult, } from "lit-element"; @@ -13,21 +13,21 @@ import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-next"; -import "../../../../../layouts/hass-tabs-subpage"; -import { haStyle } from "../../../../../resources/styles"; -import type { HomeAssistant, Route } from "../../../../../types"; -import "../../../ha-config-section"; import { - fetchOZWNodeStatus, - fetchOZWNodeMetadata, fetchOZWNodeConfig, + fetchOZWNodeMetadata, + fetchOZWNodeStatus, OZWDevice, - OZWDeviceMetaDataResponse, OZWDeviceConfig, + OZWDeviceMetaDataResponse, } from "../../../../../data/ozw"; import { ERR_NOT_FOUND } from "../../../../../data/websocket_api"; -import { showOZWRefreshNodeDialog } from "./show-dialog-ozw-refresh-node"; +import "../../../../../layouts/hass-tabs-subpage"; +import { haStyle } from "../../../../../resources/styles"; +import type { HomeAssistant, Route } from "../../../../../types"; +import "../../../ha-config-section"; import { ozwNodeTabs } from "./ozw-node-router"; +import { showOZWRefreshNodeDialog } from "./show-dialog-ozw-refresh-node"; @customElement("ozw-node-config") class OZWNodeConfig extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts index 20f49cf0bb36..9e39aa5882f6 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts @@ -4,8 +4,8 @@ import { CSSResultArray, customElement, html, - LitElement, internalProperty, + LitElement, property, TemplateResult, } from "lit-element"; @@ -13,19 +13,19 @@ import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-next"; -import "../../../../../layouts/hass-tabs-subpage"; -import { haStyle } from "../../../../../resources/styles"; -import type { HomeAssistant, Route } from "../../../../../types"; -import "../../../ha-config-section"; import { - fetchOZWNodeStatus, fetchOZWNodeMetadata, + fetchOZWNodeStatus, OZWDevice, OZWDeviceMetaDataResponse, } from "../../../../../data/ozw"; import { ERR_NOT_FOUND } from "../../../../../data/websocket_api"; -import { showOZWRefreshNodeDialog } from "./show-dialog-ozw-refresh-node"; +import "../../../../../layouts/hass-tabs-subpage"; +import { haStyle } from "../../../../../resources/styles"; +import type { HomeAssistant, Route } from "../../../../../types"; +import "../../../ha-config-section"; import { ozwNodeTabs } from "./ozw-node-router"; +import { showOZWRefreshNodeDialog } from "./show-dialog-ozw-refresh-node"; @customElement("ozw-node-dashboard") class OZWNodeDashboard extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts index 9b1b093ff677..3632eb748f61 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts @@ -2,32 +2,32 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; +import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-code-editor"; import { createCloseHeading } from "../../../../../components/ha-dialog"; -import { haStyleDialog } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; -import { ZHADeviceZigbeeInfoDialogParams } from "./show-dialog-zha-device-zigbee-info"; import { - ZHADevice, Cluster, - ZHAGroup, fetchBindableDevices, fetchGroups, + ZHADevice, + ZHAGroup, } from "../../../../../data/zha"; +import { haStyleDialog } from "../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../types"; +import { sortZHADevices, sortZHAGroups } from "./functions"; +import { ZHADeviceZigbeeInfoDialogParams } from "./show-dialog-zha-device-zigbee-info"; import { ZHAClusterSelectedParams } from "./types"; import "./zha-cluster-attributes"; import "./zha-cluster-commands"; import "./zha-clusters"; import "./zha-device-binding"; import "./zha-group-binding"; -import { HASSDomEvent } from "../../../../../common/dom/fire_event"; -import { sortZHADevices, sortZHAGroups } from "./functions"; @customElement("dialog-zha-cluster") class DialogZHACluster extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts index c3af80c7fc0f..d0fc98269f88 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts @@ -2,9 +2,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/ha-code-editor"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts index 7f56d95d9eec..eceb2fa03441 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts @@ -1,30 +1,30 @@ import "@material/mwc-button"; -import "../../../../../components/ha-icon-button"; -import "../../../../../components/ha-circular-progress"; +import { IronAutogrowTextareaElement } from "@polymer/iron-autogrow-textarea"; +import "@polymer/paper-input/paper-textarea"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; +import "../../../../../components/ha-circular-progress"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; -import "@polymer/paper-input/paper-textarea"; -import "../../../../../layouts/hass-tabs-subpage"; -import { haStyle } from "../../../../../resources/styles"; -import { HomeAssistant, Route } from "../../../../../types"; -import "./zha-device-pairing-status-card"; -import { zhaTabs } from "./zha-config-dashboard"; -import { IronAutogrowTextareaElement } from "@polymer/iron-autogrow-textarea"; import { DEVICE_MESSAGE_TYPES, LOG_OUTPUT, ZHADevice, } from "../../../../../data/zha"; +import "../../../../../layouts/hass-tabs-subpage"; +import { haStyle } from "../../../../../resources/styles"; +import { HomeAssistant, Route } from "../../../../../types"; +import { zhaTabs } from "./zha-config-dashboard"; +import "./zha-device-pairing-status-card"; @customElement("zha-add-devices-page") class ZHAAddDevicesPage extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts index 0887ccca34c6..37dd1d6bbc2f 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts @@ -1,26 +1,26 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import "../../../../../components/ha-circular-progress"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, query, } from "lit-element"; import type { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; import type { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; +import "../../../../../components/ha-circular-progress"; import { addGroup, fetchGroupableDevices, - ZHAGroup, ZHADeviceEndpoint, + ZHAGroup, } from "../../../../../data/zha"; import "../../../../../layouts/hass-error-screen"; import "../../../../../layouts/hass-subpage"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts index b2bb1c76b5e2..7727d5059382 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts @@ -1,6 +1,5 @@ import "@material/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; @@ -8,14 +7,15 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; import { Attribute, diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts index 39fc7727e26e..994071a6a447 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts @@ -1,5 +1,4 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; @@ -7,14 +6,15 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; import { Cluster, diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts index 55b6683fceae..111e5456af50 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts @@ -7,6 +7,7 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; +import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/data-table/ha-data-table"; import type { DataTableColumnContainer, @@ -15,7 +16,6 @@ import type { import type { Cluster } from "../../../../../data/zha"; import type { HomeAssistant } from "../../../../../types"; import { formatAsPaddedHex } from "./functions"; -import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; export interface ClusterRowData extends Cluster { cluster?: Cluster; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts index 1f8db25cd076..02649ff35872 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts @@ -1,20 +1,20 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; import { Cluster, diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts index 866ec1317c75..5a52b8d5a2eb 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts @@ -1,10 +1,10 @@ import { customElement, property } from "lit-element"; +import { navigate } from "../../../../../common/navigate"; import { HassRouterPage, RouterOptions, } from "../../../../../layouts/hass-router-page"; import { HomeAssistant } from "../../../../../types"; -import { navigate } from "../../../../../common/navigate"; @customElement("zha-config-dashboard-router") class ZHAConfigDashboardRouter extends HassRouterPage { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts index 29d956ceb4a8..a1fcbf1bbf40 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts @@ -1,6 +1,7 @@ +import "@material/mwc-button/mwc-button"; +import { mdiFolderMultipleOutline, mdiLan, mdiNetwork, mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import "../../../../../components/ha-fab"; import { css, CSSResultArray, @@ -10,16 +11,15 @@ import { property, TemplateResult, } from "lit-element"; +import { computeRTL } from "../../../../../common/util/compute_rtl"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-fab"; import "../../../../../components/ha-icon-next"; +import "../../../../../layouts/hass-tabs-subpage"; +import type { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant, Route } from "../../../../../types"; import "../../../ha-config-section"; -import { mdiNetwork, mdiFolderMultipleOutline, mdiPlus, mdiLan } from "@mdi/js"; -import "../../../../../layouts/hass-tabs-subpage"; -import type { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; -import { computeRTL } from "../../../../../common/util/compute_rtl"; -import "@material/mwc-button/mwc-button"; export const zhaTabs: PageNavigation[] = [ { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts index ee3435feca32..ce5d13a8e00a 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts @@ -1,6 +1,5 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { @@ -8,14 +7,15 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; import { bindDevices, unbindDevices, ZHADevice } from "../../../../../data/zha"; import { haStyle } from "../../../../../resources/styles"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts index 3644b9d49710..1364f6e2a9e0 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts @@ -1,26 +1,26 @@ import { + css, + CSSResult, customElement, html, LitElement, property, query, TemplateResult, - css, - CSSResult, } from "lit-element"; import memoizeOne from "memoize-one"; +import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/data-table/ha-data-table"; import type { DataTableColumnContainer, - HaDataTable, DataTableRowData, + HaDataTable, } from "../../../../../components/data-table/ha-data-table"; import type { ZHADeviceEndpoint, ZHAEntityReference, } from "../../../../../data/zha"; import type { HomeAssistant } from "../../../../../types"; -import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; export interface DeviceEndpointRowData extends DataTableRowData { id: string; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts index 907bb2a0241c..d3422dd82803 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts @@ -5,13 +5,15 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/entity/state-badge"; +import "../../../../../components/ha-area-picker"; import "../../../../../components/ha-card"; import "../../../../../components/ha-service-description"; import { @@ -23,10 +25,8 @@ import { } from "../../../../../data/zha"; import { haStyle } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; -import "../../../../../components/ha-area-picker"; import { formatAsPaddedHex } from "./functions"; import "./zha-device-card"; -import { classMap } from "lit-html/directives/class-map"; @customElement("zha-device-pairing-status-card") class ZHADevicePairingStatusCard extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts index 56b710b014fc..41fbe0d83c37 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts @@ -1,6 +1,5 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { @@ -8,9 +7,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, query, TemplateResult, @@ -19,6 +18,7 @@ import type { HASSDomEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/buttons/ha-call-service-button"; import { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; import { bindDeviceToGroup, diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts index 1526c4c0d81a..ae6b89f9287d 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts @@ -1,28 +1,28 @@ import "@material/mwc-button"; -import "../../../../../components/ha-icon-button"; -import "../../../../../components/ha-circular-progress"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, query, } from "lit-element"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; import { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; +import "../../../../../components/ha-circular-progress"; +import "../../../../../components/ha-icon-button"; import { addMembersToGroup, fetchGroup, fetchGroupableDevices, removeGroups, removeMembersFromGroup, - ZHAGroup, ZHADeviceEndpoint, + ZHAGroup, } from "../../../../../data/zha"; import "../../../../../layouts/hass-error-screen"; import "../../../../../layouts/hass-subpage"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts index 909cb7aecf02..42951612254f 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts @@ -1,30 +1,30 @@ import "@material/mwc-button"; -import "../../../../../components/ha-fab"; -import "../../../../../components/ha-icon-button"; -import memoizeOne from "memoize-one"; +import { mdiPlus } from "@mdi/js"; import { + css, + CSSResultArray, customElement, html, LitElement, property, PropertyValues, TemplateResult, - CSSResultArray, - css, } from "lit-element"; +import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; import { DataTableColumnContainer, RowClickedEvent, } from "../../../../../components/data-table/ha-data-table"; -import { fetchGroups, ZHAGroup, ZHADevice } from "../../../../../data/zha"; +import "../../../../../components/ha-fab"; +import "../../../../../components/ha-icon-button"; +import { fetchGroups, ZHADevice, ZHAGroup } from "../../../../../data/zha"; import "../../../../../layouts/hass-tabs-subpage-data-table"; +import { haStyle } from "../../../../../resources/styles"; import { HomeAssistant, Route } from "../../../../../types"; -import { sortZHAGroups, formatAsPaddedHex } from "./functions"; +import { formatAsPaddedHex, sortZHAGroups } from "./functions"; import { zhaTabs } from "./zha-config-dashboard"; -import { mdiPlus } from "@mdi/js"; -import { haStyle } from "../../../../../resources/styles"; export interface GroupRowData extends ZHAGroup { group?: GroupRowData; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index 3369258adbe9..898924a1ab2a 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -9,18 +9,17 @@ import { PropertyValues, query, } from "lit-element"; - +import { Edge, EdgeOptions, Network, Node } from "vis-network"; import { navigate } from "../../../../../common/navigate"; -import { fetchDevices, ZHADevice } from "../../../../../data/zha"; -import "../../../../../layouts/hass-subpage"; -import type { HomeAssistant } from "../../../../../types"; -import { Network, Edge, Node, EdgeOptions } from "vis-network"; import "../../../../../common/search/search-input"; -import "../../../../../components/ha-button-menu"; import "../../../../../components/device/ha-device-picker"; +import "../../../../../components/ha-button-menu"; import "../../../../../components/ha-svg-icon"; -import { formatAsPaddedHex } from "./functions"; +import { fetchDevices, ZHADevice } from "../../../../../data/zha"; +import "../../../../../layouts/hass-subpage"; import { PolymerChangedEvent } from "../../../../../polymer-types"; +import type { HomeAssistant } from "../../../../../types"; +import { formatAsPaddedHex } from "./functions"; @customElement("zha-network-visualization-page") export class ZHANetworkVisualizationPage extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zwave/ha-config-zwave.js b/src/panels/config/integrations/integration-panels/zwave/ha-config-zwave.js index 9c9dc1fdfc45..48f07b0989e3 100644 --- a/src/panels/config/integrations/integration-panels/zwave/ha-config-zwave.js +++ b/src/panels/config/integrations/integration-panels/zwave/ha-config-zwave.js @@ -1,7 +1,6 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; -import "../../../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; @@ -13,8 +12,9 @@ import { computeStateName } from "../../../../../common/entity/compute_state_nam import { sortStatesByName } from "../../../../../common/entity/states_sort_by_name"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; -import "../../../../../components/ha-menu-button"; +import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-icon-button-arrow-prev"; +import "../../../../../components/ha-menu-button"; import "../../../../../components/ha-service-description"; import "../../../../../layouts/ha-app-layout"; import { EventsMixin } from "../../../../../mixins/events-mixin"; diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-log.js b/src/panels/config/integrations/integration-panels/zwave/zwave-log.js index bf1bd5beb23e..f65e6e406d95 100755 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-log.js +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-log.js @@ -8,8 +8,8 @@ import isPwa from "../../../../../common/config/is_pwa"; import "../../../../../components/ha-card"; import { EventsMixin } from "../../../../../mixins/events-mixin"; import LocalizeMixin from "../../../../../mixins/localize-mixin"; -import "../../../ha-config-section"; import "../../../../../styles/polymer-ha-style"; +import "../../../ha-config-section"; let registeredDialog = false; diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts index a6326633c8ba..343cc3b479ba 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts @@ -7,9 +7,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts index 7966f0cdeb6d..948e8fe492a8 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-service-button"; diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index e3acd3f5f133..0444724f772a 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -1,6 +1,5 @@ -import "../../../components/ha-header-bar"; import "@material/mwc-icon-button/mwc-icon-button"; -import { mdiContentCopy, mdiClose } from "@mdi/js"; +import { mdiClose, mdiContentCopy } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, @@ -14,6 +13,7 @@ import { import { fireEvent } from "../../../common/dom/fire_event"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/ha-dialog"; +import "../../../components/ha-header-bar"; import "../../../components/ha-svg-icon"; import { domainToName, @@ -24,9 +24,9 @@ import { import { getLoggedErrorIntegration } from "../../../data/system_log"; import { haStyleDialog } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; +import { showToast } from "../../../util/toast"; import type { SystemLogDetailDialogParams } from "./show-dialog-system-log-detail"; import { formatSystemLogTime } from "./util"; -import { showToast } from "../../../util/toast"; class DialogSystemLogDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index 89229e41effa..9da5772c9b0b 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -1,14 +1,14 @@ import "@material/mwc-button"; -import "../../../components/ha-icon-button"; import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; +import "../../../components/ha-icon-button"; import { fetchErrorLog } from "../../../data/error_log"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/config/logs/ha-config-logs.ts b/src/panels/config/logs/ha-config-logs.ts index 178fa708633e..a8c822ccd1a1 100644 --- a/src/panels/config/logs/ha-config-logs.ts +++ b/src/panels/config/logs/ha-config-logs.ts @@ -8,13 +8,13 @@ import { query, TemplateResult, } from "lit-element"; +import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { configSections } from "../ha-panel-config"; import "./error-log-card"; import "./system-log-card"; import type { SystemLogCard } from "./system-log-card"; -import { configSections } from "../ha-panel-config"; -import "../../../layouts/hass-tabs-subpage"; @customElement("ha-config-logs") export class HaConfigLogs extends LitElement { diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index dade77f9bb15..57533373bf27 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -1,20 +1,20 @@ -import "../../../components/ha-icon-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import "../../../components/ha-circular-progress"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../components/buttons/ha-call-service-button"; import "../../../components/buttons/ha-progress-button"; import "../../../components/ha-card"; +import "../../../components/ha-circular-progress"; +import "../../../components/ha-icon-button"; import { domainToName } from "../../../data/integration"; import { fetchSystemLog, diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index d5e4a2fa5476..3ed55ea16d5e 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -4,17 +4,18 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; +import { slugify } from "../../../../common/string/slugify"; +import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../../components/ha-dialog"; +import "../../../../components/ha-formfield"; import "../../../../components/ha-icon-input"; -import type { HaSwitch } from "../../../../components/ha-switch"; import "../../../../components/ha-switch"; -import "../../../../components/ha-formfield"; -import { slugify } from "../../../../common/string/slugify"; +import type { HaSwitch } from "../../../../components/ha-switch"; import { LovelaceDashboard, LovelaceDashboardCreateParams, @@ -25,7 +26,6 @@ import { PolymerChangedEvent } from "../../../../polymer-types"; import { haStyleDialog } from "../../../../resources/styles"; import { HomeAssistant } from "../../../../types"; import { LovelaceDashboardDetailsDialogParams } from "./show-dialog-lovelace-dashboard-detail"; -import { computeRTLDirection } from "../../../../common/util/compute_rtl"; @customElement("dialog-lovelace-dashboard-detail") export class DialogLovelaceDashboardDetail extends LitElement { diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index 87af0ef6bf98..6a4f1d14c250 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -1,4 +1,3 @@ -import "../../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { @@ -17,6 +16,7 @@ import { DataTableColumnContainer, RowClickedEvent, } from "../../../../components/data-table/ha-data-table"; +import "../../../../components/ha-fab"; import "../../../../components/ha-icon"; import "../../../../components/ha-icon-button"; import "../../../../components/ha-svg-icon"; diff --git a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts index 317f05f2619d..ff4df8eb822c 100644 --- a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts +++ b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts @@ -7,9 +7,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { createCloseHeading } from "../../../../components/ha-dialog"; diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index c0f81a18f770..c1a975e71e4b 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -1,4 +1,3 @@ -import "../../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; @@ -19,6 +18,7 @@ import { DataTableColumnContainer, RowClickedEvent, } from "../../../../components/data-table/ha-data-table"; +import "../../../../components/ha-fab"; import "../../../../components/ha-icon"; import "../../../../components/ha-svg-icon"; import { diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index d9edab630fc6..9cbe669ab438 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -10,33 +10,33 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; +import { computeRTLDirection } from "../../../common/util/compute_rtl"; import "../../../components/entity/ha-entities-picker"; import { createCloseHeading } from "../../../components/ha-dialog"; +import "../../../components/ha-formfield"; import "../../../components/ha-picture-upload"; import type { HaPictureUpload } from "../../../components/ha-picture-upload"; +import { adminChangePassword } from "../../../data/auth"; import { PersonMutableParams } from "../../../data/person"; -import { CropOptions } from "../../../dialogs/image-cropper-dialog/show-image-cropper-dialog"; -import { PolymerChangedEvent } from "../../../polymer-types"; -import { haStyleDialog } from "../../../resources/styles"; -import { HomeAssistant } from "../../../types"; -import { documentationUrl } from "../../../util/documentation-url"; -import { PersonDetailDialogParams } from "./show-dialog-person-detail"; -import "../../../components/ha-formfield"; -import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { - User, - SYSTEM_GROUP_ID_ADMIN, deleteUser, + SYSTEM_GROUP_ID_ADMIN, SYSTEM_GROUP_ID_USER, updateUser, + User, } from "../../../data/user"; import { showAlertDialog, - showPromptDialog, showConfirmationDialog, + showPromptDialog, } from "../../../dialogs/generic/show-dialog-box"; -import { adminChangePassword } from "../../../data/auth"; +import { CropOptions } from "../../../dialogs/image-cropper-dialog/show-image-cropper-dialog"; +import { PolymerChangedEvent } from "../../../polymer-types"; +import { haStyleDialog } from "../../../resources/styles"; +import { HomeAssistant } from "../../../types"; +import { documentationUrl } from "../../../util/documentation-url"; import { showAddUserDialog } from "../users/show-dialog-add-user"; +import { PersonDetailDialogParams } from "./show-dialog-person-detail"; const includeDomains = ["device_tracker"]; diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 013b7dabd848..0a6a0128aea2 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; @@ -13,6 +12,7 @@ import { } from "lit-element"; import { compare } from "../../../common/string/compare"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; import "../../../components/user/ha-person-badge"; import { diff --git a/src/panels/config/scene/ha-config-scene.ts b/src/panels/config/scene/ha-config-scene.ts index 3e5d5fe9e76d..5cae67b77500 100644 --- a/src/panels/config/scene/ha-config-scene.ts +++ b/src/panels/config/scene/ha-config-scene.ts @@ -2,6 +2,7 @@ import { HassEntities } from "home-assistant-js-websocket"; import { customElement, property, PropertyValues } from "lit-element"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; +import { debounce } from "../../../common/util/debounce"; import { SceneEntity } from "../../../data/scene"; import { HassRouterPage, @@ -10,7 +11,6 @@ import { import { HomeAssistant } from "../../../types"; import "./ha-scene-dashboard"; import "./ha-scene-editor"; -import { debounce } from "../../../common/util/debounce"; const equal = (a: SceneEntity[], b: SceneEntity[]): boolean => { if (a.length !== b.length) { diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 879f1893cdf9..d9b141e9a20c 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -1,6 +1,5 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; -import { mdiPlus, mdiHelpCircle } from "@mdi/js"; +import { mdiHelpCircle, mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, @@ -17,6 +16,7 @@ import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; import { stateIcon } from "../../../common/entity/state_icon"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; +import "../../../components/ha-fab"; import "../../../components/ha-icon"; import "../../../components/ha-icon-button"; import "../../../components/ha-svg-icon"; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 73b0d2cae668..5a3e8c965ab5 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -1,4 +1,4 @@ -import "../../../components/ha-icon-button"; +import { mdiContentSave } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -8,9 +8,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -24,8 +24,10 @@ import { computeRTL } from "../../../common/util/compute_rtl"; import "../../../components/device/ha-device-picker"; import "../../../components/entity/ha-entities-picker"; import "../../../components/ha-card"; -import "../../../components/ha-icon-input"; import "../../../components/ha-fab"; +import "../../../components/ha-icon-button"; +import "../../../components/ha-icon-input"; +import "../../../components/ha-svg-icon"; import { computeDeviceName, DeviceRegistryEntry, @@ -48,18 +50,16 @@ import { SCENE_IGNORED_DOMAINS, } from "../../../data/scene"; import { - showConfirmationDialog, showAlertDialog, + showConfirmationDialog, } from "../../../dialogs/generic/show-dialog-box"; +import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { showToast } from "../../../util/toast"; import "../ha-config-section"; import { configSections } from "../ha-panel-config"; -import "../../../components/ha-svg-icon"; -import { showToast } from "../../../util/toast"; -import { mdiContentSave } from "@mdi/js"; -import { KeyboardShortcutMixin } from "../../../mixins/keyboard-shortcut-mixin"; interface DeviceEntities { id: string; diff --git a/src/panels/config/script/ha-config-script.ts b/src/panels/config/script/ha-config-script.ts index a1e9643c843a..93e52ea6a43c 100644 --- a/src/panels/config/script/ha-config-script.ts +++ b/src/panels/config/script/ha-config-script.ts @@ -2,6 +2,8 @@ import { HassEntities } from "home-assistant-js-websocket"; import { customElement, property, PropertyValues } from "lit-element"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; +import { debounce } from "../../../common/util/debounce"; +import { ScriptEntity } from "../../../data/script"; import { HassRouterPage, RouterOptions, @@ -9,8 +11,6 @@ import { import { HomeAssistant } from "../../../types"; import "./ha-script-editor"; import "./ha-script-picker"; -import { debounce } from "../../../common/util/debounce"; -import { ScriptEntity } from "../../../data/script"; const equal = (a: ScriptEntity[], b: ScriptEntity[]): boolean => { if (a.length !== b.length) { diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 76c0f886b0a4..808b4e4fae63 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -1,16 +1,15 @@ -import "../../../components/ha-fab"; +import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import "@material/mwc-list/mwc-list-item"; import { mdiCheck, + mdiContentDuplicate, mdiContentSave, mdiDelete, mdiDotsVertical, - mdiContentDuplicate, } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; -import "@material/mwc-list/mwc-list-item"; -import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; import { PaperListboxElement } from "@polymer/paper-listbox"; import { css, @@ -20,22 +19,23 @@ import { LitElement, property, PropertyValues, - TemplateResult, query, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { computeObjectId } from "../../../common/entity/compute_object_id"; import { navigate } from "../../../common/navigate"; import { slugify } from "../../../common/string/slugify"; import { computeRTL } from "../../../common/util/compute_rtl"; +import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-input"; import "../../../components/ha-svg-icon"; import "../../../components/ha-yaml-editor"; import type { HaYamlEditor } from "../../../components/ha-yaml-editor"; -import { copyToClipboard } from "../../../common/util/copy-clipboard"; import { Action, deleteScript, diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 6718ef968243..81a3d71f4dbc 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -1,5 +1,5 @@ import "@material/mwc-icon-button"; -import "../../../components/ha-icon-button"; +import { mdiHelpCircle, mdiPlus } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; import { css, @@ -14,20 +14,20 @@ import memoizeOne from "memoize-one"; import { formatDateTime } from "../../../common/datetime/format_date_time"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; +import { stateIcon } from "../../../common/entity/state_icon"; import { computeRTL } from "../../../common/util/compute_rtl"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; import "../../../components/ha-fab"; +import "../../../components/ha-icon-button"; +import "../../../components/ha-svg-icon"; import { triggerScript } from "../../../data/script"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import "../../../layouts/hass-tabs-subpage-data-table"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; +import { documentationUrl } from "../../../util/documentation-url"; import { showToast } from "../../../util/toast"; import { configSections } from "../ha-panel-config"; -import "../../../components/ha-svg-icon"; -import { mdiPlus, mdiHelpCircle } from "@mdi/js"; -import { stateIcon } from "../../../common/entity/state_icon"; -import { documentationUrl } from "../../../util/documentation-url"; @customElement("ha-script-picker") class HaScriptPicker extends LitElement { diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index 411a3393eff0..12f124d5c1b3 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -10,7 +10,6 @@ import { property, TemplateResult, } from "lit-element"; - import { fireEvent } from "../../../common/dom/fire_event"; import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-formfield"; diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 713b14d72a28..cffe11f6b525 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; import { mdiCog, @@ -18,6 +17,7 @@ import { import memoizeOne from "memoize-one"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-relative-time"; import { showAutomationEditor, TagTrigger } from "../../../data/automation"; import { diff --git a/src/panels/config/tags/tag-image.ts b/src/panels/config/tags/tag-image.ts index c1b10ca86cb5..7392b935cb62 100644 --- a/src/panels/config/tags/tag-image.ts +++ b/src/panels/config/tags/tag-image.ts @@ -1,13 +1,13 @@ +import { mdiNfcVariant } from "@mdi/js"; import { - property, + css, + CSSResult, customElement, - LitElement, html, - CSSResult, - css, + LitElement, + property, } from "lit-element"; import "../../../components/ha-svg-icon"; -import { mdiNfcVariant } from "@mdi/js"; import { TagRowData } from "./ha-config-tags"; @customElement("tag-image") diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index b854da06669a..7882b5ba162a 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -13,8 +13,8 @@ import { } from "lit-element"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../components/ha-dialog"; -import "../../../components/ha-help-tooltip"; import "../../../components/ha-formfield"; +import "../../../components/ha-help-tooltip"; import "../../../components/ha-switch"; import { adminChangePassword } from "../../../data/auth"; import { diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index db920b223f99..74dde61fc336 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import { mdiPlus } from "@mdi/js"; import { customElement, @@ -13,6 +12,7 @@ import { DataTableColumnContainer, RowClickedEvent, } from "../../../components/data-table/ha-data-table"; +import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; import { deleteUser, fetchUsers, updateUser, User } from "../../../data/user"; import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index f31f5e0565f6..b2dd80773420 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -4,16 +4,17 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; import { addDistanceToCoord } from "../../../common/location/add_distance_to_coord"; +import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../components/ha-dialog"; -import "../../../components/ha-switch"; import "../../../components/ha-formfield"; +import "../../../components/ha-switch"; import "../../../components/map/ha-location-editor"; import { defaultRadiusColor, @@ -24,7 +25,6 @@ import { import { haStyleDialog } from "../../../resources/styles"; import { HomeAssistant } from "../../../types"; import { ZoneDetailDialogParams } from "./show-dialog-zone-detail"; -import { computeRTLDirection } from "../../../common/util/compute_rtl"; class DialogZoneDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index e64476fef677..e000a4c7dd79 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -4,8 +4,8 @@ import { CustomPanelInfo } from "../../data/panel_custom"; import { HomeAssistant, Route } from "../../types"; import { createCustomPanelElement } from "../../util/custom-panel/create-custom-panel-element"; import { - loadCustomPanel, getUrl, + loadCustomPanel, } from "../../util/custom-panel/load-custom-panel"; import { setCustomPanelProperties } from "../../util/custom-panel/set-custom-panel-properties"; diff --git a/src/panels/developer-tools/event/developer-tools-event.js b/src/panels/developer-tools/event/developer-tools-event.js index ec7526fee9e0..7da723ee44e8 100644 --- a/src/panels/developer-tools/event/developer-tools-event.js +++ b/src/panels/developer-tools/event/developer-tools-event.js @@ -9,8 +9,8 @@ import "../../../components/ha-code-editor"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; -import { documentationUrl } from "../../../util/documentation-url"; import "../../../styles/polymer-ha-style"; +import { documentationUrl } from "../../../util/documentation-url"; import "./event-subscribe-card"; import "./events-list"; diff --git a/src/panels/developer-tools/event/event-subscribe-card.ts b/src/panels/developer-tools/event/event-subscribe-card.ts index f2f386d1ec78..7d8350d0dede 100644 --- a/src/panels/developer-tools/event/event-subscribe-card.ts +++ b/src/panels/developer-tools/event/event-subscribe-card.ts @@ -6,9 +6,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { formatTime } from "../../../common/datetime/format_time"; diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index 630853e5cad2..4aaa321050ce 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -1,9 +1,6 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import "../../layouts/ha-app-layout"; -import "../../components/ha-icon-button"; import "@polymer/paper-tabs/paper-tab"; -import "../../components/ha-tabs"; import { css, CSSResultArray, @@ -14,7 +11,10 @@ import { TemplateResult, } from "lit-element"; import { navigate } from "../../common/navigate"; +import "../../components/ha-icon-button"; import "../../components/ha-menu-button"; +import "../../components/ha-tabs"; +import "../../layouts/ha-app-layout"; import { haStyle } from "../../resources/styles"; import { HomeAssistant, Route } from "../../types"; import "./developer-tools-router"; diff --git a/src/panels/developer-tools/service/developer-tools-service.js b/src/panels/developer-tools/service/developer-tools-service.js index 71c2a91949ac..73eee7278880 100644 --- a/src/panels/developer-tools/service/developer-tools-service.js +++ b/src/panels/developer-tools/service/developer-tools-service.js @@ -5,9 +5,9 @@ import { safeDump, safeLoad } from "js-yaml"; import { computeRTL } from "../../../common/util/compute_rtl"; import "../../../components/buttons/ha-progress-button"; import "../../../components/entity/ha-entity-picker"; +import "../../../components/ha-card"; import "../../../components/ha-code-editor"; import "../../../components/ha-service-picker"; -import "../../../components/ha-card"; import { ENTITY_COMPONENT_DOMAINS } from "../../../data/entity"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import LocalizeMixin from "../../../mixins/localize-mixin"; diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 02f6e67ec21f..eb5f6c580aa3 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -1,20 +1,20 @@ import "@material/mwc-button"; +import { mdiInformationOutline } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { safeDump, safeLoad } from "js-yaml"; +import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; +import { computeRTL } from "../../../common/util/compute_rtl"; import "../../../components/entity/ha-entity-picker"; -import "../../../components/ha-svg-icon"; import "../../../components/ha-code-editor"; +import "../../../components/ha-svg-icon"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; import "../../../styles/polymer-ha-style"; -import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; -import { mdiInformationOutline } from "@mdi/js"; -import { computeRTL } from "../../../common/util/compute_rtl"; const ERROR_SENTINEL = {}; /* diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index dcfa3272855a..80f9591547d7 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -1,24 +1,24 @@ -import "../../layouts/ha-app-layout"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { computeRTL } from "../../common/util/compute_rtl"; -import "../../components/ha-menu-button"; -import "../../components/state-history-charts"; import { - LitElement, css, - property, internalProperty, + LitElement, + property, PropertyValues, } from "lit-element"; import { html } from "lit-html"; -import { haStyle } from "../../resources/styles"; -import { HomeAssistant } from "../../types"; -import type { DateRangePickerRanges } from "../../components/ha-date-range-picker"; -import "../../components/ha-date-range-picker"; +import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/entity/ha-entity-picker"; -import { fetchDate, computeHistory } from "../../data/history"; import "../../components/ha-circular-progress"; +import "../../components/ha-date-range-picker"; +import type { DateRangePickerRanges } from "../../components/ha-date-range-picker"; +import "../../components/ha-menu-button"; +import "../../components/state-history-charts"; +import { computeHistory, fetchDate } from "../../data/history"; +import "../../layouts/ha-app-layout"; +import { haStyle } from "../../resources/styles"; +import { HomeAssistant } from "../../types"; class HaPanelHistory extends LitElement { @property() hass!: HomeAssistant; diff --git a/src/panels/lovelace/badges/hui-entity-filter-badge.ts b/src/panels/lovelace/badges/hui-entity-filter-badge.ts index d1dec2692067..71ec50e8fc93 100644 --- a/src/panels/lovelace/badges/hui-entity-filter-badge.ts +++ b/src/panels/lovelace/badges/hui-entity-filter-badge.ts @@ -1,3 +1,9 @@ +import { + internalProperty, + property, + PropertyValues, + UpdatingElement, +} from "lit-element"; import { HomeAssistant } from "../../../types"; import { evaluateFilter } from "../common/evaluate-filter"; import { processConfigEntities } from "../common/process-config-entities"; @@ -5,12 +11,6 @@ import { createBadgeElement } from "../create-element/create-badge-element"; import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceBadge } from "../types"; import { EntityFilterBadgeConfig } from "./types"; -import { - UpdatingElement, - property, - internalProperty, - PropertyValues, -} from "lit-element"; class EntityFilterBadge extends UpdatingElement implements LovelaceBadge { @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/src/panels/lovelace/badges/hui-error-badge.ts b/src/panels/lovelace/badges/hui-error-badge.ts index 3ecec0067834..abb18344ab1c 100644 --- a/src/panels/lovelace/badges/hui-error-badge.ts +++ b/src/panels/lovelace/badges/hui-error-badge.ts @@ -3,8 +3,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import "../../../components/ha-label-badge"; diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index ef21e4c8b777..dd5ec60b6f87 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -28,8 +28,8 @@ import { stateIcon } from "../../../common/entity/state_icon"; import { isValidEntityId } from "../../../common/entity/valid_entity_id"; import { iconColorCSS } from "../../../common/style/icon_color_css"; import "../../../components/ha-card"; -import { ActionHandlerEvent } from "../../../data/lovelace"; import { LightEntity } from "../../../data/light"; +import { ActionHandlerEvent } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; import { actionHandler } from "../common/directives/action-handler-directive"; import { findEntities } from "../common/find-entites"; diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index 66b071c752c1..8ec63a66be66 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -15,10 +15,12 @@ import { computeStateDisplay } from "../../../common/entity/compute_state_displa import { computeStateName } from "../../../common/entity/compute_state_name"; import { stateIcon } from "../../../common/entity/state_icon"; import { isValidEntityId } from "../../../common/entity/valid_entity_id"; +import { formatNumber } from "../../../common/string/format_number"; import "../../../components/ha-card"; import "../../../components/ha-icon"; import { UNAVAILABLE_STATES } from "../../../data/entity"; import { HomeAssistant } from "../../../types"; +import { computeCardSize } from "../common/compute-card-size"; import { findEntities } from "../common/find-entites"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { createEntityNotFoundWarning } from "../components/hui-warning"; @@ -30,8 +32,6 @@ import { } from "../types"; import { HuiErrorCard } from "./hui-error-card"; import { EntityCardConfig } from "./types"; -import { computeCardSize } from "../common/compute-card-size"; -import { formatNumber } from "../../../common/string/format_number"; @customElement("hui-entity-card") export class HuiEntityCard extends LitElement implements LovelaceCard { diff --git a/src/panels/lovelace/cards/hui-entity-filter-card.ts b/src/panels/lovelace/cards/hui-entity-filter-card.ts index 00f6d120e88c..734de7033d00 100644 --- a/src/panels/lovelace/cards/hui-entity-filter-card.ts +++ b/src/panels/lovelace/cards/hui-entity-filter-card.ts @@ -1,18 +1,18 @@ +import { + internalProperty, + property, + PropertyValues, + UpdatingElement, +} from "lit-element"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; +import { computeCardSize } from "../common/compute-card-size"; import { evaluateFilter } from "../common/evaluate-filter"; import { processConfigEntities } from "../common/process-config-entities"; import { createCardElement } from "../create-element/create-card-element"; import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceCard } from "../types"; import { EntityFilterCardConfig } from "./types"; -import { - property, - internalProperty, - PropertyValues, - UpdatingElement, -} from "lit-element"; -import { computeCardSize } from "../common/compute-card-size"; class EntityFilterCard extends UpdatingElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/panels/lovelace/cards/hui-error-card.ts b/src/panels/lovelace/cards/hui-error-card.ts index 194a423a3210..2b57b026e7a1 100644 --- a/src/panels/lovelace/cards/hui-error-card.ts +++ b/src/panels/lovelace/cards/hui-error-card.ts @@ -1,16 +1,16 @@ +import { safeDump } from "js-yaml"; import { css, CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { LovelaceCard } from "../types"; import { ErrorCardConfig } from "./types"; -import { safeDump } from "js-yaml"; @customElement("hui-error-card") export class HuiErrorCard extends LitElement implements LovelaceCard { diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index cecfa156a6b3..48e49d6432a2 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -17,8 +17,8 @@ import { computeStateName } from "../../../common/entity/compute_state_name"; import { isValidEntityId } from "../../../common/entity/valid_entity_id"; import "../../../components/ha-card"; import "../../../components/ha-gauge"; -import type { HomeAssistant } from "../../../types"; import { UNAVAILABLE } from "../../../data/entity"; +import type { HomeAssistant } from "../../../types"; import { findEntities } from "../common/find-entites"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { createEntityNotFoundWarning } from "../components/hui-warning"; diff --git a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts index 306217a3983d..efe402d52db7 100644 --- a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts +++ b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts @@ -29,7 +29,10 @@ class HuiHorizontalStackCard extends HuiStackCard { } #root > * { flex: 1 1 0; - margin: var(--horizontal-stack-card-margin, var(--stack-card-margin, 0 4px)); + margin: var( + --horizontal-stack-card-margin, + var(--stack-card-margin, 0 4px) + ); min-width: 0; } #root > *:first-child { diff --git a/src/panels/lovelace/cards/hui-media-control-card.ts b/src/panels/lovelace/cards/hui-media-control-card.ts index 104dc85b0002..f901767a9d54 100644 --- a/src/panels/lovelace/cards/hui-media-control-card.ts +++ b/src/panels/lovelace/cards/hui-media-control-card.ts @@ -21,8 +21,8 @@ import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; import { stateIcon } from "../../../common/entity/state_icon"; import { supportsFeature } from "../../../common/entity/supports-feature"; -import { debounce } from "../../../common/util/debounce"; import { extractColors } from "../../../common/image/extract_color"; +import { debounce } from "../../../common/util/debounce"; import "../../../components/ha-card"; import "../../../components/ha-icon"; import "../../../components/ha-icon-button"; @@ -30,14 +30,14 @@ import "../../../components/ha-svg-icon"; import { showMediaBrowserDialog } from "../../../components/media-player/show-media-browser-dialog"; import { UNAVAILABLE_STATES } from "../../../data/entity"; import { - computeMediaDescription, computeMediaControls, + computeMediaDescription, getCurrentProgress, MediaPickedEvent, + MediaPlayerEntity, SUPPORT_BROWSE_MEDIA, SUPPORT_SEEK, SUPPORT_TURN_ON, - MediaPlayerEntity, } from "../../../data/media-player"; import type { HomeAssistant } from "../../../types"; import { findEntities } from "../common/find-entites"; diff --git a/src/panels/lovelace/cards/hui-shopping-list-card.ts b/src/panels/lovelace/cards/hui-shopping-list-card.ts index 921b6fdcd532..a1bbfdd2c783 100644 --- a/src/panels/lovelace/cards/hui-shopping-list-card.ts +++ b/src/panels/lovelace/cards/hui-shopping-list-card.ts @@ -1,3 +1,4 @@ +import { mdiDrag, mdiNotificationClearAll, mdiPlus, mdiSort } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; @@ -10,13 +11,12 @@ import { LitElement, property, PropertyValues, - TemplateResult, query, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; -import { repeat } from "lit-html/directives/repeat"; import { guard } from "lit-html/directives/guard"; -import { mdiDrag, mdiSort, mdiPlus, mdiNotificationClearAll } from "@mdi/js"; +import { repeat } from "lit-html/directives/repeat"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/ha-card"; import "../../../components/ha-icon"; @@ -24,9 +24,9 @@ import { addItem, clearItems, fetchItems, + reorderItems, ShoppingListItem, updateItem, - reorderItems, } from "../../../data/shopping-list"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/cards/hui-stack-card.ts b/src/panels/lovelace/cards/hui-stack-card.ts index d7724d6a3c3c..2262eea99656 100644 --- a/src/panels/lovelace/cards/hui-stack-card.ts +++ b/src/panels/lovelace/cards/hui-stack-card.ts @@ -2,9 +2,9 @@ import { css, CSSResult, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/cards/hui-starting-card.ts b/src/panels/lovelace/cards/hui-starting-card.ts index 883cca483cea..d7f90b2b2f68 100644 --- a/src/panels/lovelace/cards/hui-starting-card.ts +++ b/src/panels/lovelace/cards/hui-starting-card.ts @@ -1,4 +1,5 @@ import "@material/mwc-button/mwc-button"; +import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; import { css, CSSResult, @@ -6,16 +7,15 @@ import { html, LitElement, property, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; +import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-card"; import "../../../components/ha-circular-progress"; +import { LovelaceCardConfig } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; import { LovelaceCard } from "../types"; -import { LovelaceCardConfig } from "../../../data/lovelace"; -import { fireEvent } from "../../../common/dom/fire_event"; -import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; @customElement("hui-starting-card") export class HuiStartingCard extends LitElement implements LovelaceCard { diff --git a/src/panels/lovelace/cards/hui-vertical-stack-card.ts b/src/panels/lovelace/cards/hui-vertical-stack-card.ts index 77f34ddc9167..dfb01c4a84f3 100644 --- a/src/panels/lovelace/cards/hui-vertical-stack-card.ts +++ b/src/panels/lovelace/cards/hui-vertical-stack-card.ts @@ -29,7 +29,10 @@ class HuiVerticalStackCard extends HuiStackCard { height: 100%; } #root > * { - margin: var(--vertical-stack-card-margin, var(--stack-card-margin, 4px 0)); + margin: var( + --vertical-stack-card-margin, + var(--stack-card-margin, 4px 0) + ); } #root > *:first-child { margin-top: 0; diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index 156e76d3a7c2..09dec715733c 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -26,8 +26,8 @@ import { getWeatherUnit, getWind, weatherAttrIcons, - weatherSVGStyles, WeatherEntity, + weatherSVGStyles, } from "../../../data/weather"; import type { HomeAssistant } from "../../../types"; import { actionHandler } from "../common/directives/action-handler-directive"; diff --git a/src/panels/lovelace/common/handle-action.ts b/src/panels/lovelace/common/handle-action.ts index bb6467b2c1d1..053056c3258f 100644 --- a/src/panels/lovelace/common/handle-action.ts +++ b/src/panels/lovelace/common/handle-action.ts @@ -2,9 +2,9 @@ import { fireEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; import { forwardHaptic } from "../../../data/haptics"; import { ActionConfig } from "../../../data/lovelace"; +import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; import { HomeAssistant } from "../../../types"; import { toggleEntity } from "./entity/toggle-entity"; -import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; declare global { interface HASSDomEvents { diff --git a/src/panels/lovelace/common/structs/is-entity-id.ts b/src/panels/lovelace/common/structs/is-entity-id.ts index f88e466880ff..c408187e8497 100644 --- a/src/panels/lovelace/common/structs/is-entity-id.ts +++ b/src/panels/lovelace/common/structs/is-entity-id.ts @@ -1,4 +1,4 @@ -import { StructResult, StructContext, struct } from "superstruct"; +import { struct, StructContext, StructResult } from "superstruct"; const isEntityId = (value: unknown, context: StructContext): StructResult => { if (typeof value !== "string") { diff --git a/src/panels/lovelace/common/structs/is-icon.ts b/src/panels/lovelace/common/structs/is-icon.ts index d88dcdb59343..7ca4ff9ed515 100644 --- a/src/panels/lovelace/common/structs/is-icon.ts +++ b/src/panels/lovelace/common/structs/is-icon.ts @@ -1,4 +1,4 @@ -import { StructContext, StructResult, struct } from "superstruct"; +import { struct, StructContext, StructResult } from "superstruct"; const isIcon = (value: unknown, context: StructContext): StructResult => { if (typeof value !== "string") { diff --git a/src/panels/lovelace/common/validate-condition.ts b/src/panels/lovelace/common/validate-condition.ts index 0aca5f2e11f2..8d99b874878d 100644 --- a/src/panels/lovelace/common/validate-condition.ts +++ b/src/panels/lovelace/common/validate-condition.ts @@ -1,5 +1,5 @@ -import { HomeAssistant } from "../../../types"; import { UNAVAILABLE } from "../../../data/entity"; +import { HomeAssistant } from "../../../types"; export interface Condition { entity: string; diff --git a/src/panels/lovelace/components/hui-buttons-base.ts b/src/panels/lovelace/components/hui-buttons-base.ts index 84d9ff81c75a..919b5058e81a 100644 --- a/src/panels/lovelace/components/hui-buttons-base.ts +++ b/src/panels/lovelace/components/hui-buttons-base.ts @@ -8,19 +8,16 @@ import { queryAll, TemplateResult, } from "lit-element"; - import { computeStateName } from "../../../common/entity/compute_state_name"; -import { computeTooltip } from "../common/compute-tooltip"; -import { actionHandler } from "../common/directives/action-handler-directive"; -import { handleAction } from "../common/handle-action"; -import { hasAction } from "../common/has-action"; - +import "../../../components/entity/state-badge"; import type { StateBadge } from "../../../components/entity/state-badge"; import type { ActionHandlerEvent } from "../../../data/lovelace"; import type { HomeAssistant } from "../../../types"; import type { EntitiesCardEntityConfig } from "../cards/types"; - -import "../../../components/entity/state-badge"; +import { computeTooltip } from "../common/compute-tooltip"; +import { actionHandler } from "../common/directives/action-handler-directive"; +import { handleAction } from "../common/handle-action"; +import { hasAction } from "../common/has-action"; @customElement("hui-buttons-base") export class HuiButtonsBase extends LitElement { diff --git a/src/panels/lovelace/components/hui-conditional-base.ts b/src/panels/lovelace/components/hui-conditional-base.ts index 2089b144e831..46446558dff1 100644 --- a/src/panels/lovelace/components/hui-conditional-base.ts +++ b/src/panels/lovelace/components/hui-conditional-base.ts @@ -1,8 +1,8 @@ import { customElement, property, - UpdatingElement, PropertyValues, + UpdatingElement, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { ConditionalCardConfig } from "../cards/types"; diff --git a/src/panels/lovelace/components/hui-graph-base.ts b/src/panels/lovelace/components/hui-graph-base.ts index b076e02b4d3c..5aff51875858 100644 --- a/src/panels/lovelace/components/hui-graph-base.ts +++ b/src/panels/lovelace/components/hui-graph-base.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, svg, TemplateResult, diff --git a/src/panels/lovelace/components/hui-input-list-editor.ts b/src/panels/lovelace/components/hui-input-list-editor.ts index 3c6247e30e0b..d80c2bd989ff 100644 --- a/src/panels/lovelace/components/hui-input-list-editor.ts +++ b/src/panels/lovelace/components/hui-input-list-editor.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-icon-button"; import "@polymer/paper-input/paper-input"; import { css, @@ -10,6 +9,7 @@ import { TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; +import "../../../components/ha-icon-button"; import { HomeAssistant } from "../../../types"; import { EditorTarget } from "../editor/types"; diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index 20583e94a6a6..8fab650212db 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -1,9 +1,9 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/components/hui-views-list.ts b/src/panels/lovelace/components/hui-views-list.ts index 71e51cccde35..7307369601f1 100644 --- a/src/panels/lovelace/components/hui-views-list.ts +++ b/src/panels/lovelace/components/hui-views-list.ts @@ -5,8 +5,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../common/dom/fire_event"; diff --git a/src/panels/lovelace/custom-card-helpers.ts b/src/panels/lovelace/custom-card-helpers.ts index 36efb72a7083..3c4508ca0b54 100644 --- a/src/panels/lovelace/custom-card-helpers.ts +++ b/src/panels/lovelace/custom-card-helpers.ts @@ -1,6 +1,6 @@ +export { importMoreInfoControl } from "../../dialogs/more-info/state_more_info_control"; export { createBadgeElement } from "./create-element/create-badge-element"; export { createCardElement } from "./create-element/create-card-element"; export { createHeaderFooterElement } from "./create-element/create-header-footer-element"; export { createHuiElement } from "./create-element/create-hui-element"; export { createRowElement } from "./create-element/create-row-element"; -export { importMoreInfoControl } from "../../dialogs/more-info/state_more_info_control"; diff --git a/src/panels/lovelace/editor/add-entities-to-view.ts b/src/panels/lovelace/editor/add-entities-to-view.ts index 318df70429e3..f08f89c1d840 100644 --- a/src/panels/lovelace/editor/add-entities-to-view.ts +++ b/src/panels/lovelace/editor/add-entities-to-view.ts @@ -1,14 +1,14 @@ import { fetchConfig, - LovelaceConfig, - saveConfig, fetchDashboards, + LovelaceConfig, LovelacePanelConfig, + saveConfig, } from "../../../data/lovelace"; +import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { HomeAssistant } from "../../../types"; import { showSuggestCardDialog } from "./card-editor/show-suggest-card-dialog"; import { showSelectViewDialog } from "./select-view/show-select-view-dialog"; -import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; export const addEntitiesToLovelaceView = async ( element: HTMLElement, diff --git a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts index b91593d64314..9cb788265515 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts @@ -1,11 +1,11 @@ import "@polymer/paper-input/paper-textarea"; +import { property, PropertyValues, UpdatingElement } from "lit-element"; import { computeRTL } from "../../../../common/util/compute_rtl"; import { LovelaceCardConfig } from "../../../../data/lovelace"; import { HomeAssistant } from "../../../../types"; import { createCardElement } from "../../create-element/create-card-element"; -import { LovelaceCard } from "../../types"; import { createErrorCardConfig } from "../../create-element/create-element-base"; -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { LovelaceCard } from "../../types"; export class HuiCardPreview extends UpdatingElement { @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts index b70afdd32ecb..3db6ca72f6a6 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts @@ -5,9 +5,9 @@ import { CSSResultArray, customElement, html, + internalProperty, LitElement, property, - internalProperty, query, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts b/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts index c9e2bb6f03d1..a4f3e47a1982 100644 --- a/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts +++ b/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts @@ -8,8 +8,8 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; -import { fireEvent } from "../../../../common/dom/fire_event"; import type { HASSDomEvent } from "../../../../common/dom/fire_event"; +import { fireEvent } from "../../../../common/dom/fire_event"; import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import "../../../../components/data-table/ha-data-table"; import type { diff --git a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts index fa13a3c860f5..8a18b7060e7b 100644 --- a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts @@ -1,18 +1,18 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; +import { assert, object, optional, string } from "superstruct"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/entity/ha-entity-picker"; import { HomeAssistant } from "../../../../types"; import { MediaControlCardConfig } from "../../cards/types"; import { LovelaceCardEditor } from "../../types"; import { EditorTarget, EntitiesEditorEvent } from "../types"; -import { assert, object, string, optional } from "superstruct"; const cardConfigStruct = object({ type: string(), diff --git a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts index f82fb7e9bb75..218cb3465c61 100644 --- a/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-shopping-list-editor.ts @@ -4,11 +4,12 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; +import { assert, object, optional, string } from "superstruct"; import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; import { fireEvent } from "../../../../common/dom/fire_event"; import { HomeAssistant } from "../../../../types"; @@ -16,7 +17,6 @@ import { ShoppingListCardConfig } from "../../cards/types"; import "../../components/hui-theme-select-editor"; import { LovelaceCardEditor } from "../../types"; import { EditorTarget, EntitiesEditorEvent } from "../types"; -import { string, assert, object, optional } from "superstruct"; const cardConfigStruct = object({ type: string(), diff --git a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts index 20519718df86..e5beba3c6b19 100644 --- a/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-stack-card-editor.ts @@ -16,11 +16,11 @@ import { any, array, assert, + boolean, + number, object, optional, string, - boolean, - number, } from "superstruct"; import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event"; import { LovelaceCardConfig, LovelaceConfig } from "../../../../data/lovelace"; diff --git a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts index 614a83c41bb4..55d8a97c1733 100644 --- a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts @@ -10,10 +10,10 @@ import { import { assert, boolean, object, optional, string } from "superstruct"; import { fireEvent } from "../../../../common/dom/fire_event"; import { computeRTLDirection } from "../../../../common/util/compute_rtl"; +import "../../../../components/entity/ha-entity-attribute-picker"; import "../../../../components/entity/ha-entity-picker"; import "../../../../components/ha-formfield"; import "../../../../components/ha-switch"; -import "../../../../components/entity/ha-entity-attribute-picker"; import { HomeAssistant } from "../../../../types"; import { WeatherForecastCardConfig } from "../../cards/types"; import "../../components/hui-theme-select-editor"; diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts index c41c4ba593f3..520fc01f0995 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts @@ -5,14 +5,14 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; -import "../../../../components/ha-circular-progress"; import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog"; +import "../../../../components/ha-circular-progress"; import type { LovelaceConfig } from "../../../../data/lovelace"; import { haStyleDialog } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; diff --git a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts index 9720fad71f54..ddada3fd5d82 100644 --- a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts +++ b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts @@ -1,26 +1,26 @@ +import "@polymer/paper-item/paper-item"; import { + css, + CSSResultArray, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, - css, - CSSResultArray, } from "lit-element"; import "../../../../components/dialog/ha-paper-dialog"; -import "../../components/hui-views-list"; -import type { SelectViewDialogParams } from "./show-select-view-dialog"; -import { HomeAssistant } from "../../../../types"; -import { haStyleDialog } from "../../../../resources/styles"; import { createCloseHeading } from "../../../../components/ha-dialog"; import "../../../../components/ha-paper-dropdown-menu"; -import "@polymer/paper-item/paper-item"; import { - LovelaceDashboard, + fetchConfig, fetchDashboards, LovelaceConfig, - fetchConfig, + LovelaceDashboard, } from "../../../../data/lovelace"; +import { haStyleDialog } from "../../../../resources/styles"; +import { HomeAssistant } from "../../../../types"; +import "../../components/hui-views-list"; +import type { SelectViewDialogParams } from "./show-select-view-dialog"; @customElement("hui-dialog-select-view") export class HuiDialogSelectView extends LitElement { diff --git a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts index b13d38e4f100..9a74ed6958fe 100644 --- a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts +++ b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts @@ -1,32 +1,29 @@ -import "../../../../components/ha-fab"; +import { mdiPlus } from "@mdi/js"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; -import { mdiPlus } from "@mdi/js"; import { classMap } from "lit-html/directives/class-map"; - import { computeDomain } from "../../../../common/entity/compute_domain"; import { computeStateName } from "../../../../common/entity/compute_state_name"; import { computeRTL } from "../../../../common/util/compute_rtl"; -import { computeUnusedEntities } from "../../common/compute-unused-entities"; -import { showSuggestCardDialog } from "../card-editor/show-suggest-card-dialog"; -import { showSelectViewDialog } from "../select-view/show-select-view-dialog"; - import type { DataTableRowData } from "../../../../components/data-table/ha-data-table"; +import "../../../../components/ha-fab"; +import "../../../../components/ha-svg-icon"; import type { LovelaceConfig } from "../../../../data/lovelace"; import type { HomeAssistant } from "../../../../types"; +import { computeUnusedEntities } from "../../common/compute-unused-entities"; import type { Lovelace } from "../../types"; - import "../card-editor/hui-entity-picker-table"; -import "../../../../components/ha-svg-icon"; +import { showSuggestCardDialog } from "../card-editor/show-suggest-card-dialog"; +import { showSelectViewDialog } from "../select-view/show-select-view-dialog"; @customElement("hui-unused-entities") export class HuiUnusedEntities extends LitElement { diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 0459cfa6c281..dd68616125e0 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -1,5 +1,4 @@ import "@material/mwc-button"; -import "../../../../components/ha-icon-button"; import "@polymer/paper-tabs/paper-tab"; import "@polymer/paper-tabs/paper-tabs"; import { @@ -7,15 +6,16 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { HASSDomEvent } from "../../../../common/dom/fire_event"; import { navigate } from "../../../../common/navigate"; -import "../../../../components/ha-dialog"; import "../../../../components/ha-circular-progress"; +import "../../../../components/ha-dialog"; +import "../../../../components/ha-icon-button"; import type { LovelaceBadgeConfig, LovelaceCardConfig, diff --git a/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts b/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts index 10d18157a97b..9f13c1dd8ce0 100644 --- a/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts +++ b/src/panels/lovelace/editor/view-editor/show-edit-view-dialog.ts @@ -1,6 +1,6 @@ import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event"; -import { Lovelace } from "../../types"; import { LovelaceViewConfig } from "../../../../data/lovelace"; +import { Lovelace } from "../../types"; declare global { // for fire event diff --git a/src/panels/lovelace/elements/hui-service-button-element.ts b/src/panels/lovelace/elements/hui-service-button-element.ts index 0bac32a64797..4709fc3136d9 100644 --- a/src/panels/lovelace/elements/hui-service-button-element.ts +++ b/src/panels/lovelace/elements/hui-service-button-element.ts @@ -3,8 +3,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import "../../../components/buttons/ha-call-service-button"; diff --git a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts index b66341bb9a52..f4c44a563385 100644 --- a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts index fb8cc2226597..4fe7860a9571 100644 --- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts @@ -3,9 +3,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts index e36441c6e2bb..bd3bedfed377 100644 --- a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts @@ -1,12 +1,12 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, - TemplateResult, query, + TemplateResult, } from "lit-element"; import "../../../components/ha-date-input"; import type { HaDateInput } from "../../../components/ha-date-input"; @@ -17,8 +17,8 @@ import { setInputDateTimeValue } from "../../../data/input_datetime"; import type { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; -import type { EntityConfig, LovelaceRow } from "./types"; import { createEntityNotFoundWarning } from "../components/hui-warning"; +import type { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-input-datetime-entity-row") class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts index 50148f4536c9..8780106c1028 100644 --- a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; @@ -17,8 +17,8 @@ import { setValue } from "../../../data/input_text"; import { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; -import { EntityConfig, LovelaceRow } from "./types"; import { createEntityNotFoundWarning } from "../components/hui-warning"; +import { EntityConfig, LovelaceRow } from "./types"; @customElement("hui-input-number-entity-row") class HuiInputNumberEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts index 0d889f8aaad5..aa2ca5c4dcbb 100644 --- a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts @@ -5,9 +5,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts index b79fa2e699cd..672202830359 100644 --- a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts index c8ae2e0b9987..f8b8b662915d 100644 --- a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index ef7269c43f29..f7a067a5f315 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -1,25 +1,28 @@ -import "../../../components/ha-icon-button"; import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; +import { computeStateDisplay } from "../../../common/entity/compute_state_display"; import { supportsFeature } from "../../../common/entity/supports-feature"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { debounce } from "../../../common/util/debounce"; +import "../../../components/ha-icon-button"; import "../../../components/ha-slider"; -import { UNAVAILABLE, UNKNOWN, UNAVAILABLE_STATES } from "../../../data/entity"; +import { UNAVAILABLE, UNAVAILABLE_STATES, UNKNOWN } from "../../../data/entity"; import { - SUPPORT_PLAY, + computeMediaDescription, + MediaPlayerEntity, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, + SUPPORT_PLAY, SUPPORT_PREVIOUS_TRACK, SUPPORT_STOP, SUPPORT_TURN_OFF, @@ -27,16 +30,13 @@ import { SUPPORT_VOLUME_BUTTONS, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, - computeMediaDescription, - MediaPlayerEntity, } from "../../../data/media-player"; import type { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; +import { installResizeObserver } from "../common/install-resize-observer"; import "../components/hui-generic-entity-row"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import type { EntityConfig, LovelaceRow } from "./types"; -import { installResizeObserver } from "../common/install-resize-observer"; -import { computeStateDisplay } from "../../../common/entity/compute_state_display"; @customElement("hui-media-player-entity-row") class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts index ad9d655856d2..e0eec278051c 100644 --- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts @@ -4,9 +4,9 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts index ac2e0d3a1317..ea348d0bdf99 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -4,19 +4,19 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { canExcecute, ScriptEntity } from "../../../data/script"; import { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import { ActionRowConfig, LovelaceRow } from "./types"; -import { canExcecute, ScriptEntity } from "../../../data/script"; @customElement("hui-script-entity-row") class HuiScriptEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts index 68a736caa7e5..cd62d9bd317b 100644 --- a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts @@ -3,26 +3,26 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; +import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { ActionHandlerEvent } from "../../../data/lovelace"; import { SENSOR_DEVICE_CLASS_TIMESTAMP } from "../../../data/sensor"; import { HomeAssistant } from "../../../types"; +import { EntitiesCardEntityConfig } from "../cards/types"; +import { actionHandler } from "../common/directives/action-handler-directive"; +import { handleAction } from "../common/handle-action"; +import { hasAction } from "../common/has-action"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import "../components/hui-timestamp-display"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import { LovelaceRow } from "./types"; -import { EntitiesCardEntityConfig } from "../cards/types"; -import { actionHandler } from "../common/directives/action-handler-directive"; -import { hasAction } from "../common/has-action"; -import { ActionHandlerEvent } from "../../../data/lovelace"; -import { handleAction } from "../common/handle-action"; -import { UNAVAILABLE_STATES } from "../../../data/entity"; interface SensorEntityConfig extends EntitiesCardEntityConfig { format?: "relative" | "total" | "date" | "time" | "datetime"; diff --git a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts index c00678990f80..2296fa163b8d 100644 --- a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts @@ -3,26 +3,26 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; +import { DOMAINS_HIDE_MORE_INFO } from "../../../common/const"; +import { computeDomain } from "../../../common/entity/compute_domain"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; +import { ActionHandlerEvent } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; +import { EntitiesCardEntityConfig } from "../cards/types"; +import { actionHandler } from "../common/directives/action-handler-directive"; +import { handleAction } from "../common/handle-action"; +import { hasAction } from "../common/has-action"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import { LovelaceRow } from "./types"; -import { DOMAINS_HIDE_MORE_INFO } from "../../../common/const"; -import { computeDomain } from "../../../common/entity/compute_domain"; -import { actionHandler } from "../common/directives/action-handler-directive"; -import { hasAction } from "../common/has-action"; -import { ActionHandlerEvent } from "../../../data/lovelace"; -import { handleAction } from "../common/handle-action"; -import { classMap } from "lit-html/directives/class-map"; -import { EntitiesCardEntityConfig } from "../cards/types"; @customElement("hui-text-entity-row") class HuiTextEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts index 685221f8210c..a2b52c911500 100644 --- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts @@ -1,9 +1,9 @@ import { customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; diff --git a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts index 26226e2e5740..dae998fb9ffc 100644 --- a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts @@ -3,39 +3,38 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { ifDefined } from "lit-html/directives/if-defined"; - +import { DOMAINS_HIDE_MORE_INFO } from "../../../common/const"; +import { computeDomain } from "../../../common/entity/compute_domain"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; +import { computeStateName } from "../../../common/entity/compute_state_name"; +import { stateIcon } from "../../../common/entity/state_icon"; import "../../../components/entity/state-badge"; import { UNAVAILABLE_STATES } from "../../../data/entity"; +import { ActionHandlerEvent } from "../../../data/lovelace"; import { getSecondaryWeatherAttribute, - getWeatherUnit, getWeatherStateIcon, - weatherSVGStyles, + getWeatherUnit, WeatherEntity, + weatherSVGStyles, } from "../../../data/weather"; import type { HomeAssistant } from "../../../types"; import type { EntitiesCardEntityConfig } from "../cards/types"; +import { actionHandler } from "../common/directives/action-handler-directive"; +import { handleAction } from "../common/handle-action"; +import { hasAction } from "../common/has-action"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import { createEntityNotFoundWarning } from "../components/hui-warning"; import type { LovelaceRow } from "./types"; -import { DOMAINS_HIDE_MORE_INFO } from "../../../common/const"; -import { computeDomain } from "../../../common/entity/compute_domain"; -import { actionHandler } from "../common/directives/action-handler-directive"; -import { hasAction } from "../common/has-action"; -import { computeStateName } from "../../../common/entity/compute_state_name"; -import { ActionHandlerEvent } from "../../../data/lovelace"; -import { handleAction } from "../common/handle-action"; -import { stateIcon } from "../../../common/entity/state_icon"; @customElement("hui-weather-entity-row") class HuiWeatherEntityRow extends LitElement implements LovelaceRow { diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 8cd3e9336c3a..0335fd20f399 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -2,9 +2,9 @@ import "@material/mwc-button"; import deepFreeze from "deep-freeze"; import { html, + internalProperty, LitElement, property, - internalProperty, TemplateResult, } from "lit-element"; import { domainToName } from "../../data/integration"; diff --git a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts index c7c949be7f13..7b49288f4180 100644 --- a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts @@ -5,8 +5,8 @@ import { html, LitElement, property, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { ifDefined } from "lit-html/directives/if-defined"; diff --git a/src/panels/lovelace/header-footer/types.ts b/src/panels/lovelace/header-footer/types.ts index 52c1a83f3983..2514649dda15 100644 --- a/src/panels/lovelace/header-footer/types.ts +++ b/src/panels/lovelace/header-footer/types.ts @@ -1,5 +1,5 @@ +import { array, number, object, optional, string, union } from "superstruct"; import { ActionConfig } from "../../../data/lovelace"; -import { object, optional, union, string, number, array } from "superstruct"; import { actionConfigStruct, entitiesConfigStruct } from "../editor/types"; import { EntityConfig } from "../entity-rows/types"; diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index aa95125acc7c..e2c9ed095146 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -3,17 +3,17 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; -import { AttributeRowConfig, LovelaceRow } from "../entity-rows/types"; import { createEntityNotFoundWarning } from "../components/hui-warning"; +import { AttributeRowConfig, LovelaceRow } from "../entity-rows/types"; @customElement("hui-attribute-row") class HuiAttributeRow extends LitElement implements LovelaceRow { @@ -57,8 +57,7 @@ class HuiAttributeRow extends LitElement implements LovelaceRow { return html`
- ${this._config.prefix} ${attribute ?? "-"} - ${this._config.suffix} + ${this._config.prefix} ${attribute ?? "-"} ${this._config.suffix}
`; diff --git a/src/panels/lovelace/special-rows/hui-buttons-row.ts b/src/panels/lovelace/special-rows/hui-buttons-row.ts index f910df90b009..4643c11f3195 100644 --- a/src/panels/lovelace/special-rows/hui-buttons-row.ts +++ b/src/panels/lovelace/special-rows/hui-buttons-row.ts @@ -1,10 +1,10 @@ import { customElement, html, + internalProperty, LitElement, property, TemplateResult, - internalProperty, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { processConfigEntities } from "../common/process-config-entities"; diff --git a/src/panels/lovelace/special-rows/hui-cast-row.ts b/src/panels/lovelace/special-rows/hui-cast-row.ts index 22d6369b2dd0..851b4430d0b9 100644 --- a/src/panels/lovelace/special-rows/hui-cast-row.ts +++ b/src/panels/lovelace/special-rows/hui-cast-row.ts @@ -4,11 +4,11 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, - TemplateResult, PropertyValues, + TemplateResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { CastManager } from "../../../cast/cast_manager"; diff --git a/src/panels/lovelace/special-rows/hui-text-row.ts b/src/panels/lovelace/special-rows/hui-text-row.ts index 7fb0b435eb61..6f12ce2eeca9 100644 --- a/src/panels/lovelace/special-rows/hui-text-row.ts +++ b/src/panels/lovelace/special-rows/hui-text-row.ts @@ -3,8 +3,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.ts b/src/panels/lovelace/special-rows/hui-weblink-row.ts index e5502d006b6b..fed13977c98d 100644 --- a/src/panels/lovelace/special-rows/hui-weblink-row.ts +++ b/src/panels/lovelace/special-rows/hui-weblink-row.ts @@ -3,8 +3,8 @@ import { CSSResult, customElement, html, - LitElement, internalProperty, + LitElement, TemplateResult, } from "lit-element"; import "../../../components/ha-icon"; diff --git a/src/panels/mailbox/ha-dialog-show-audio-message.js b/src/panels/mailbox/ha-dialog-show-audio-message.js index 790d3b4ab60b..3314d8784f43 100644 --- a/src/panels/mailbox/ha-dialog-show-audio-message.js +++ b/src/panels/mailbox/ha-dialog-show-audio-message.js @@ -1,9 +1,9 @@ import "@material/mwc-button"; -import "../../components/ha-circular-progress"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import "../../components/dialog/ha-paper-dialog"; +import "../../components/ha-circular-progress"; import LocalizeMixin from "../../mixins/localize-mixin"; import "../../styles/polymer-ha-style-dialog"; diff --git a/src/panels/mailbox/ha-panel-mailbox.js b/src/panels/mailbox/ha-panel-mailbox.js index 087ddfa94131..98e3e5aba67a 100644 --- a/src/panels/mailbox/ha-panel-mailbox.js +++ b/src/panels/mailbox/ha-panel-mailbox.js @@ -1,18 +1,18 @@ import "@material/mwc-button"; -import "../../layouts/ha-app-layout"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-input/paper-textarea"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-tabs/paper-tab"; -import "../../components/ha-tabs"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { formatDateTime } from "../../common/datetime/format_date_time"; import "../../components/ha-card"; import "../../components/ha-menu-button"; +import "../../components/ha-tabs"; +import "../../layouts/ha-app-layout"; import { EventsMixin } from "../../mixins/events-mixin"; import LocalizeMixin from "../../mixins/localize-mixin"; import "../../styles/polymer-ha-style"; diff --git a/src/panels/map/ha-panel-map.js b/src/panels/map/ha-panel-map.js index f6b299526a9c..e42a8c233be5 100644 --- a/src/panels/map/ha-panel-map.js +++ b/src/panels/map/ha-panel-map.js @@ -3,8 +3,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { - setupLeafletMap, replaceTileLayer, + setupLeafletMap, } from "../../common/dom/setup-leaflet-map"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { computeStateName } from "../../common/entity/compute_state_name"; @@ -12,10 +12,10 @@ import { navigate } from "../../common/navigate"; import "../../components/ha-icon"; import "../../components/ha-menu-button"; import { defaultRadiusColor } from "../../data/zone"; +import "../../layouts/ha-app-layout"; import LocalizeMixin from "../../mixins/localize-mixin"; -import "./ha-entity-marker"; import "../../styles/polymer-ha-style"; -import "../../layouts/ha-app-layout"; +import "./ha-entity-marker"; /* * @appliesMixin LocalizeMixin diff --git a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts index ea04f9033efe..9a68172b112f 100644 --- a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts +++ b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts @@ -10,8 +10,8 @@ import { import { fireEvent } from "../../common/dom/fire_event"; import { createCloseHeading } from "../../components/ha-dialog"; import "../../components/ha-hls-player"; -import type { HomeAssistant } from "../../types"; import { haStyleDialog } from "../../resources/styles"; +import type { HomeAssistant } from "../../types"; import { WebBrowserPlayMediaDialogParams } from "./show-media-player-dialog"; @customElement("hui-dialog-web-browser-play-media") diff --git a/src/panels/profile/ha-advanced-mode-row.ts b/src/panels/profile/ha-advanced-mode-row.ts index 4cd23aa8df78..ed9a2a022236 100644 --- a/src/panels/profile/ha-advanced-mode-row.ts +++ b/src/panels/profile/ha-advanced-mode-row.ts @@ -8,13 +8,13 @@ import { TemplateResult, } from "lit-element"; import "../../components/ha-card"; +import "../../components/ha-settings-row"; import "../../components/ha-switch"; import { CoreFrontendUserData, getOptimisticFrontendUserDataCollection, } from "../../data/frontend"; import { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; @customElement("ha-advanced-mode-row") class AdvancedModeRow extends LitElement { diff --git a/src/panels/profile/ha-change-password-card.ts b/src/panels/profile/ha-change-password-card.ts index 06c66fe3d42d..a54cb4eff376 100644 --- a/src/panels/profile/ha-change-password-card.ts +++ b/src/panels/profile/ha-change-password-card.ts @@ -1,5 +1,6 @@ -import "@polymer/paper-input/paper-input"; +import "@material/mwc-button"; import "@polymer/paper-dialog/paper-dialog"; +import "@polymer/paper-input/paper-input"; import { css, CSSResult, @@ -11,9 +12,8 @@ import { PropertyValues, TemplateResult, } from "lit-element"; -import "@material/mwc-button"; -import "../../components/ha-circular-progress"; import "../../components/ha-card"; +import "../../components/ha-circular-progress"; import { haStyle } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; diff --git a/src/panels/profile/ha-enable-shortcuts-row.ts b/src/panels/profile/ha-enable-shortcuts-row.ts index 8fb362c76bfd..cdec57a03b3f 100644 --- a/src/panels/profile/ha-enable-shortcuts-row.ts +++ b/src/panels/profile/ha-enable-shortcuts-row.ts @@ -6,10 +6,10 @@ import { TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-settings-row"; import "../../components/ha-switch"; import type { HaSwitch } from "../../components/ha-switch"; import type { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; @customElement("ha-enable-shortcuts-row") class HaEnableShortcutsRow extends LitElement { diff --git a/src/panels/profile/ha-force-narrow-row.ts b/src/panels/profile/ha-force-narrow-row.ts index a11616ab36ab..49d70ef57f2b 100644 --- a/src/panels/profile/ha-force-narrow-row.ts +++ b/src/panels/profile/ha-force-narrow-row.ts @@ -6,10 +6,10 @@ import { TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-settings-row"; import "../../components/ha-switch"; import type { HaSwitch } from "../../components/ha-switch"; import type { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; @customElement("ha-force-narrow-row") class HaForcedNarrowRow extends LitElement { diff --git a/src/panels/profile/ha-mfa-module-setup-flow.js b/src/panels/profile/ha-mfa-module-setup-flow.js index 0da5f41804fb..2e4a66fd1f15 100644 --- a/src/panels/profile/ha-mfa-module-setup-flow.js +++ b/src/panels/profile/ha-mfa-module-setup-flow.js @@ -1,10 +1,10 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; -import "../../components/ha-circular-progress"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import "../../components/dialog/ha-paper-dialog"; +import "../../components/ha-circular-progress"; import "../../components/ha-form/ha-form"; import "../../components/ha-markdown"; import { EventsMixin } from "../../mixins/events-mixin"; diff --git a/src/panels/profile/ha-mfa-modules-card.js b/src/panels/profile/ha-mfa-modules-card.js index dc8e56af80b8..a118d6e1ccb0 100644 --- a/src/panels/profile/ha-mfa-modules-card.js +++ b/src/panels/profile/ha-mfa-modules-card.js @@ -5,9 +5,9 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import "../../components/ha-card"; +import { showConfirmationDialog } from "../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../mixins/events-mixin"; import LocalizeMixin from "../../mixins/localize-mixin"; -import { showConfirmationDialog } from "../../dialogs/generic/show-dialog-box"; import "../../styles/polymer-ha-style"; let registeredDialog = false; diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index 9ce8a0bb6e77..7c007c8a3be9 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -28,6 +28,7 @@ import { haStyle } from "../../resources/styles"; import { HomeAssistant } from "../../types"; import "./ha-advanced-mode-row"; import "./ha-change-password-card"; +import "./ha-enable-shortcuts-row"; import "./ha-force-narrow-row"; import "./ha-long-lived-access-tokens-card"; import "./ha-mfa-modules-card"; @@ -38,7 +39,6 @@ import "./ha-push-notifications-row"; import "./ha-refresh-tokens-card"; import "./ha-set-suspend-row"; import "./ha-set-vibrate-row"; -import "./ha-enable-shortcuts-row"; class HaPanelProfile extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; diff --git a/src/panels/profile/ha-pick-dashboard-row.ts b/src/panels/profile/ha-pick-dashboard-row.ts index c8e9765b568e..ba749ee6ea04 100644 --- a/src/panels/profile/ha-pick-dashboard-row.ts +++ b/src/panels/profile/ha-pick-dashboard-row.ts @@ -3,17 +3,17 @@ import "@polymer/paper-listbox/paper-listbox"; import { customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; import "../../components/ha-paper-dropdown-menu"; +import "../../components/ha-settings-row"; import { fetchDashboards, LovelaceDashboard } from "../../data/lovelace"; import { setDefaultPanel } from "../../data/panel"; import { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; @customElement("ha-pick-dashboard-row") class HaPickDashboardRow extends LitElement { diff --git a/src/panels/profile/ha-pick-language-row.js b/src/panels/profile/ha-pick-language-row.js index 59019e027a63..d5f540015fd5 100644 --- a/src/panels/profile/ha-pick-language-row.js +++ b/src/panels/profile/ha-pick-language-row.js @@ -4,9 +4,9 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; import "../../components/ha-paper-dropdown-menu"; +import "../../components/ha-settings-row"; import { EventsMixin } from "../../mixins/events-mixin"; import LocalizeMixin from "../../mixins/localize-mixin"; -import "../../components/ha-settings-row"; /* * @appliesMixin LocalizeMixin diff --git a/src/panels/profile/ha-push-notifications-row.js b/src/panels/profile/ha-push-notifications-row.js index f564d8754f64..429173ffd2aa 100644 --- a/src/panels/profile/ha-push-notifications-row.js +++ b/src/panels/profile/ha-push-notifications-row.js @@ -5,8 +5,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { pushSupported } from "../../components/ha-push-notifications-toggle"; -import LocalizeMixin from "../../mixins/localize-mixin"; import "../../components/ha-settings-row"; +import LocalizeMixin from "../../mixins/localize-mixin"; import { documentationUrl } from "../../util/documentation-url"; /* diff --git a/src/panels/profile/ha-set-suspend-row.ts b/src/panels/profile/ha-set-suspend-row.ts index f734c7c0c7d1..9874590295fd 100644 --- a/src/panels/profile/ha-set-suspend-row.ts +++ b/src/panels/profile/ha-set-suspend-row.ts @@ -6,10 +6,10 @@ import { TemplateResult, } from "lit-element"; import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event"; +import "../../components/ha-settings-row"; import "../../components/ha-switch"; import type { HaSwitch } from "../../components/ha-switch"; import type { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; declare global { // for fire event diff --git a/src/panels/profile/ha-set-vibrate-row.ts b/src/panels/profile/ha-set-vibrate-row.ts index e5ae63ad8891..d0e7701dfbde 100644 --- a/src/panels/profile/ha-set-vibrate-row.ts +++ b/src/panels/profile/ha-set-vibrate-row.ts @@ -6,11 +6,11 @@ import { TemplateResult, } from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-settings-row"; import "../../components/ha-switch"; import type { HaSwitch } from "../../components/ha-switch"; import { forwardHaptic } from "../../data/haptics"; import type { HomeAssistant } from "../../types"; -import "../../components/ha-settings-row"; @customElement("ha-set-vibrate-row") class HaSetVibrateRow extends LitElement { diff --git a/src/panels/shopping-list/ha-panel-shopping-list.ts b/src/panels/shopping-list/ha-panel-shopping-list.ts index aa5915831ceb..76ee4d76cb93 100644 --- a/src/panels/shopping-list/ha-panel-shopping-list.ts +++ b/src/panels/shopping-list/ha-panel-shopping-list.ts @@ -1,3 +1,4 @@ +import { mdiMicrophone } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { @@ -12,18 +13,15 @@ import { TemplateResult, } from "lit-element"; import memoizeOne from "memoize-one"; -import { mdiMicrophone } from "@mdi/js"; - -import { HomeAssistant } from "../../types"; -import { haStyle } from "../../resources/styles"; -import { createCardElement } from "../lovelace/create-element/create-card-element"; -import { LovelaceCard } from "../lovelace/types"; -import { HuiErrorCard } from "../lovelace/cards/hui-error-card"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; -import { showVoiceCommandDialog } from "../../dialogs/voice-command-dialog/show-ha-voice-command-dialog"; - import "../../components/ha-menu-button"; +import { showVoiceCommandDialog } from "../../dialogs/voice-command-dialog/show-ha-voice-command-dialog"; import "../../layouts/ha-app-layout"; +import { haStyle } from "../../resources/styles"; +import { HomeAssistant } from "../../types"; +import { HuiErrorCard } from "../lovelace/cards/hui-error-card"; +import { createCardElement } from "../lovelace/create-element/create-card-element"; +import { LovelaceCard } from "../lovelace/types"; @customElement("ha-panel-shopping-list") class PanelShoppingList extends LitElement { diff --git a/src/resources/compatibility.ts b/src/resources/compatibility.ts index c6807b248467..8cec91966601 100644 --- a/src/resources/compatibility.ts +++ b/src/resources/compatibility.ts @@ -1,10 +1,10 @@ +// For localize +import "@formatjs/intl-getcanonicallocales/polyfill"; import "core-js"; -import "regenerator-runtime/runtime"; -import "unfetch/polyfill"; // To use comlink under ES5 import "proxy-polyfill"; -// For localize -import "@formatjs/intl-getcanonicallocales/polyfill"; +import "regenerator-runtime/runtime"; +import "unfetch/polyfill"; // Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md (function (arr) { diff --git a/src/resources/markdown_worker.ts b/src/resources/markdown_worker.ts index 0a72f60b5114..5545a87f358f 100644 --- a/src/resources/markdown_worker.ts +++ b/src/resources/markdown_worker.ts @@ -1,7 +1,7 @@ // To use comlink under ES5 -import "proxy-polyfill"; import { expose } from "comlink"; import marked from "marked"; +import "proxy-polyfill"; import { filterXSS, getDefaultWhiteList } from "xss"; interface WhiteList { diff --git a/src/resources/render-markdown.ts b/src/resources/render-markdown.ts index ee873b784987..28f5a9d00233 100644 --- a/src/resources/render-markdown.ts +++ b/src/resources/render-markdown.ts @@ -1,5 +1,4 @@ import { wrap } from "comlink"; - import type { api } from "./markdown_worker"; type RenderMarkdownType = api["renderMarkdown"]; diff --git a/src/state-summary/state-card-script.ts b/src/state-summary/state-card-script.ts index 35e653bad140..44e14d0aeec9 100644 --- a/src/state-summary/state-card-script.ts +++ b/src/state-summary/state-card-script.ts @@ -1,18 +1,18 @@ import "@material/mwc-button"; -import "../components/entity/ha-entity-toggle"; -import "../components/entity/state-info"; -import { HomeAssistant } from "../types"; +import { HassEntity } from "home-assistant-js-websocket"; import { - html, + CSSResult, customElement, + html, LitElement, property, - CSSResult, } from "lit-element"; -import { HassEntity } from "home-assistant-js-websocket"; -import { haStyle } from "../resources/styles"; +import "../components/entity/ha-entity-toggle"; +import "../components/entity/state-info"; import { UNAVAILABLE_STATES } from "../data/entity"; import { canExcecute, ScriptEntity } from "../data/script"; +import { haStyle } from "../resources/styles"; +import { HomeAssistant } from "../types"; @customElement("state-card-script") export class StateCardScript extends LitElement { diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index 895b6427db6c..c4414f0a7b47 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -3,10 +3,10 @@ import { callService, Connection, ERR_INVALID_AUTH, + HassConfig, subscribeConfig, subscribeEntities, subscribeServices, - HassConfig, } from "home-assistant-js-websocket"; import { fireEvent } from "../common/dom/fire_event"; import { broadcastConnectionStatus } from "../data/connection-status"; diff --git a/src/state/dialog-manager-mixin.ts b/src/state/dialog-manager-mixin.ts index 9e86636785ed..b75db54c836d 100644 --- a/src/state/dialog-manager-mixin.ts +++ b/src/state/dialog-manager-mixin.ts @@ -1,8 +1,8 @@ +import { PropertyValues } from "lit-element"; import { HASSDomEvent } from "../common/dom/fire_event"; import { makeDialogManager, showDialog } from "../dialogs/make-dialog-manager"; import { Constructor } from "../types"; import { HassBaseEl } from "./hass-base-mixin"; -import { PropertyValues } from "lit-element"; interface RegisterDialogParams { dialogShowEvent: keyof HASSDomEvents; diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index 8751e4782480..1bf402ce8ff3 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -1,11 +1,11 @@ -import { Constructor } from "../types"; -import { showToast } from "../util/toast"; -import { HassBaseEl } from "./hass-base-mixin"; import { STATE_NOT_RUNNING, - STATE_STARTING, STATE_RUNNING, + STATE_STARTING, } from "home-assistant-js-websocket"; +import { Constructor } from "../types"; +import { showToast } from "../util/toast"; +import { HassBaseEl } from "./hass-base-mixin"; export default >(superClass: T) => class extends superClass { diff --git a/src/state/hass-element.ts b/src/state/hass-element.ts index 0c9c1fd2c019..7a24238c2306 100644 --- a/src/state/hass-element.ts +++ b/src/state/hass-element.ts @@ -5,6 +5,7 @@ import { dialogManagerMixin } from "./dialog-manager-mixin"; import DisconnectToastMixin from "./disconnect-toast-mixin"; import { hapticMixin } from "./haptic-mixin"; import { HassBaseEl } from "./hass-base-mixin"; +import { loggingMixin } from "./logging-mixin"; import MoreInfoMixin from "./more-info-mixin"; import NotificationMixin from "./notification-mixin"; import { panelTitleMixin } from "./panel-title-mixin"; @@ -12,7 +13,6 @@ import SidebarMixin from "./sidebar-mixin"; import ThemesMixin from "./themes-mixin"; import TranslationsMixin from "./translations-mixin"; import { urlSyncMixin } from "./url-sync-mixin"; -import { loggingMixin } from "./logging-mixin"; const ext = (baseClass: T, mixins): T => mixins.reduceRight((base, mixin) => mixin(base), baseClass); diff --git a/src/state/more-info-mixin.ts b/src/state/more-info-mixin.ts index f41a11af3d76..dd0cf17c0c66 100644 --- a/src/state/more-info-mixin.ts +++ b/src/state/more-info-mixin.ts @@ -1,9 +1,9 @@ +import type { PropertyValues } from "lit-element"; +import type { HASSDomEvent } from "../common/dom/fire_event"; import { showDialog } from "../dialogs/make-dialog-manager"; +import type { MoreInfoDialogParams } from "../dialogs/more-info/ha-more-info-dialog"; import type { Constructor } from "../types"; import type { HassBaseEl } from "./hass-base-mixin"; -import type { MoreInfoDialogParams } from "../dialogs/more-info/ha-more-info-dialog"; -import type { PropertyValues } from "lit-element"; -import type { HASSDomEvent } from "../common/dom/fire_event"; declare global { // for fire event diff --git a/src/state/quick-bar-mixin.ts b/src/state/quick-bar-mixin.ts index ceac362aa10f..c09ce8040200 100644 --- a/src/state/quick-bar-mixin.ts +++ b/src/state/quick-bar-mixin.ts @@ -1,12 +1,12 @@ -import tinykeys from "tinykeys"; import type { Constructor, PropertyValues } from "lit-element"; -import { HassElement } from "./hass-element"; +import tinykeys from "tinykeys"; import { QuickBarParams, showQuickBar, } from "../dialogs/quick-bar/show-dialog-quick-bar"; import { HomeAssistant } from "../types"; import { storeState } from "../util/ha-pref-storage"; +import { HassElement } from "./hass-element"; declare global { interface HASSDomEvents { From 91c8e7ebff2435649d34773922c283fba29d6285 Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Thu, 7 Jan 2021 10:42:51 +0000 Subject: [PATCH 2/2] Move /compatibility --- .devcontainer/devcontainer.json | 10 ++-------- demo/src/ha-demo.ts | 3 ++- hassio/src/entrypoint.ts | 1 + src/entrypoints/authorize.ts | 2 +- src/entrypoints/core.ts | 2 +- src/entrypoints/custom-panel.ts | 3 ++- src/entrypoints/onboarding.ts | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b00d00ac0b18..99f904767192 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,16 +24,10 @@ "editor.formatOnSave": true, "editor.formatOnType": true, "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.codeActionsOnSave": { - "source.organizeImports": true - } + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.codeActionsOnSave": { - "source.organizeImports": true - } + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "files.trimTrailingWhitespace": true } diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index 0ad775e0c403..921420e45b2d 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -1,3 +1,5 @@ +// Compat needs to be first import +import "../../src/resources/compatibility"; import { isNavigationClick } from "../../src/common/dom/is-navigation-click"; import { navigate } from "../../src/common/navigate"; import { @@ -5,7 +7,6 @@ import { provideHass, } from "../../src/fake_data/provide_hass"; import { HomeAssistantAppEl } from "../../src/layouts/home-assistant"; -import "../../src/resources/compatibility"; import { HomeAssistant } from "../../src/types"; import { selectedDemoConfig } from "./configs/demo-configs"; import { mockAuth } from "./stubs/auth"; diff --git a/hassio/src/entrypoint.ts b/hassio/src/entrypoint.ts index 46f4722f9cae..24d3e45359e4 100644 --- a/hassio/src/entrypoint.ts +++ b/hassio/src/entrypoint.ts @@ -1,3 +1,4 @@ +// Compat needs to be first import import "../../src/resources/compatibility"; import "../../src/resources/roboto"; import "../../src/resources/safari-14-attachshadow-patch"; diff --git a/src/entrypoints/authorize.ts b/src/entrypoints/authorize.ts index 3a5432c64c2a..45857e5998de 100644 --- a/src/entrypoints/authorize.ts +++ b/src/entrypoints/authorize.ts @@ -1,8 +1,8 @@ // Compat needs to be first import +import "../resources/compatibility"; import "@polymer/polymer/lib/elements/dom-if"; import "@polymer/polymer/lib/elements/dom-repeat"; import "../auth/ha-authorize"; -import "../resources/compatibility"; import "../resources/ha-style"; import "../resources/roboto"; import "../resources/safari-14-attachshadow-patch"; diff --git a/src/entrypoints/core.ts b/src/entrypoints/core.ts index baab96734e13..4da6a8fb891a 100644 --- a/src/entrypoints/core.ts +++ b/src/entrypoints/core.ts @@ -1,4 +1,5 @@ // Compat needs to be first import +import "../resources/compatibility"; import { Auth, Connection, @@ -22,7 +23,6 @@ import { subscribePanels } from "../data/ws-panels"; import { subscribeThemes } from "../data/ws-themes"; import { subscribeUser } from "../data/ws-user"; import type { ExternalAuth } from "../external_app/external_auth"; -import "../resources/compatibility"; import "../resources/safari-14-attachshadow-patch"; import { HomeAssistant } from "../types"; diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index 5ccb0aa2c1af..0f25084f375d 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -1,9 +1,10 @@ +// Compat needs to be first import +import "../resources/compatibility"; import { PolymerElement } from "@polymer/polymer"; import { fireEvent } from "../common/dom/fire_event"; import { loadJS } from "../common/dom/load_resource"; import { webComponentsSupported } from "../common/feature-detect/support-web-components"; import { CustomPanelInfo } from "../data/panel_custom"; -import "../resources/compatibility"; import "../resources/safari-14-attachshadow-patch"; import { createCustomPanelElement } from "../util/custom-panel/create-custom-panel-element"; import { loadCustomPanel } from "../util/custom-panel/load-custom-panel"; diff --git a/src/entrypoints/onboarding.ts b/src/entrypoints/onboarding.ts index 1ab99556a91a..9c085ed82f66 100644 --- a/src/entrypoints/onboarding.ts +++ b/src/entrypoints/onboarding.ts @@ -1,6 +1,6 @@ // Compat needs to be first import -import "../onboarding/ha-onboarding"; import "../resources/compatibility"; +import "../onboarding/ha-onboarding"; import "../resources/ha-style"; import "../resources/roboto"; import "../resources/safari-14-attachshadow-patch";