diff --git a/src/dialogs/mqtt-device-debug-info-dialog/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts similarity index 85% rename from src/dialogs/mqtt-device-debug-info-dialog/dialog-mqtt-device-debug-info.ts rename to src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index 80b3326e64..5bad83bf07 100644 --- a/src/dialogs/mqtt-device-debug-info-dialog/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -8,15 +8,18 @@ import { property, TemplateResult, } from "lit-element"; -import { computeStateName } from "../../common/entity/compute_state_name"; -import "../../components/ha-dialog"; -import "../../components/ha-switch"; -import "../../components/ha-formfield"; -import type { HaSwitch } from "../../components/ha-switch"; -import { computeDeviceName } from "../../data/device_registry"; -import { fetchMQTTDebugInfo, MQTTDeviceDebugInfo } from "../../data/mqtt"; -import { haStyleDialog } from "../../resources/styles"; -import { HomeAssistant } from "../../types"; +import { computeStateName } from "../../../../../../common/entity/compute_state_name"; +import "../../../../../../components/ha-dialog"; +import "../../../../../../components/ha-switch"; +import "../../../../../../components/ha-formfield"; +import type { HaSwitch } from "../../../../../../components/ha-switch"; +import { computeDeviceName } from "../../../../../../data/device_registry"; +import { + fetchMQTTDebugInfo, + MQTTDeviceDebugInfo, +} from "../../../../../../data/mqtt"; +import { haStyleDialog } from "../../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../../types"; import "./mqtt-discovery-payload"; import "./mqtt-messages"; import { MQTTDeviceDebugInfoDialogParams } from "./show-dialog-mqtt-device-debug-info"; @@ -187,19 +190,19 @@ class DialogMQTTDeviceDebugInfo extends LitElement {
  • MQTT discovery data:
  • ` diff --git a/src/panels/config/devices/device-detail/integration-elements/ha-device-actions-mqtt.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts similarity index 72% rename from src/panels/config/devices/device-detail/integration-elements/ha-device-actions-mqtt.ts rename to src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts index 5ff0862c54..fd81b7bbe0 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ha-device-actions-mqtt.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts @@ -7,12 +7,12 @@ import { 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 "../../../../../dialogs/mqtt-device-debug-info-dialog/show-dialog-mqtt-device-debug-info"; -import { haStyle } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; +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"; @customElement("ha-device-actions-mqtt") export class HaDeviceActionsMqtt extends LitElement { diff --git a/src/dialogs/mqtt-device-debug-info-dialog/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts similarity index 100% rename from src/dialogs/mqtt-device-debug-info-dialog/mqtt-discovery-payload.ts rename to src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts diff --git a/src/dialogs/mqtt-device-debug-info-dialog/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts similarity index 95% rename from src/dialogs/mqtt-device-debug-info-dialog/mqtt-messages.ts rename to src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index e3877c96d3..08952bfedc 100644 --- a/src/dialogs/mqtt-device-debug-info-dialog/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -9,9 +9,9 @@ import { 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 { formatTimeWithSeconds } from "../../../../../../common/datetime/format_time"; +import { HomeAssistant } from "../../../../../../types"; +import { MQTTMessage } from "../../../../../../data/mqtt"; @customElement("mqtt-messages") class MQTTMessages extends LitElement { diff --git a/src/dialogs/mqtt-device-debug-info-dialog/show-dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/show-dialog-mqtt-device-debug-info.ts similarity index 79% rename from src/dialogs/mqtt-device-debug-info-dialog/show-dialog-mqtt-device-debug-info.ts rename to src/panels/config/devices/device-detail/integration-elements/mqtt/show-dialog-mqtt-device-debug-info.ts index 92fe6554cc..8c5397f84f 100644 --- a/src/dialogs/mqtt-device-debug-info-dialog/show-dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/show-dialog-mqtt-device-debug-info.ts @@ -1,5 +1,5 @@ -import { fireEvent } from "../../common/dom/fire_event"; -import { DeviceRegistryEntry } from "../../data/device_registry"; +import { fireEvent } from "../../../../../../common/dom/fire_event"; +import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; export interface MQTTDeviceDebugInfoDialogParams { device: DeviceRegistryEntry; diff --git a/src/panels/config/devices/device-detail/integration-elements/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts similarity index 85% rename from src/panels/config/devices/device-detail/integration-elements/ha-device-actions-zha.ts rename to src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index 641209e782..89321d5201 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -8,17 +8,17 @@ import { css, PropertyValues, } from "lit-element"; -import { DeviceRegistryEntry } from "../../../../../data/device_registry"; -import { haStyle } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; +import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; +import { haStyle } from "../../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../../types"; import { ZHADevice, fetchZHADevice, reconfigureNode, -} from "../../../../../data/zha"; -import { navigate } from "../../../../../common/navigate"; -import { showZHADeviceZigbeeInfoDialog } from "../../../../../dialogs/zha-device-zigbee-signature-dialog/show-dialog-zha-device-zigbee-info"; -import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dialog-box"; +} from "../../../../../../data/zha"; +import { navigate } from "../../../../../../common/navigate"; +import { showZHADeviceZigbeeInfoDialog } from "../../../../../../dialogs/zha-device-zigbee-signature-dialog/show-dialog-zha-device-zigbee-info"; +import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-dialog-box"; @customElement("ha-device-actions-zha") export class HaDeviceActionsZha extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/ha-device-info-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts similarity index 86% rename from src/panels/config/devices/device-detail/integration-elements/ha-device-info-zha.ts rename to src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts index 822cbc0f82..d84e3ecb0c 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ha-device-info-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts @@ -8,11 +8,11 @@ import { css, PropertyValues, } from "lit-element"; -import { DeviceRegistryEntry } from "../../../../../data/device_registry"; -import { haStyle } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; -import { ZHADevice, fetchZHADevice } from "../../../../../data/zha"; -import { formatAsPaddedHex } from "../../../integrations/integration-panels/zha/functions"; +import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; +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") export class HaDeviceActionsZha 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 8248cc0f29..41f7906f0b 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -477,7 +477,9 @@ export class HaConfigDevicePage extends LitElement { ): TemplateResult[] { const templates: TemplateResult[] = []; if (integrations.includes("mqtt")) { - import("./device-detail/integration-elements/ha-device-actions-mqtt"); + import( + "./device-detail/integration-elements/mqtt/ha-device-actions-mqtt" + ); templates.push(html`
    + import( + /* webpackChunkName: "panel-config-mqtt" */ "./integrations/integration-panels/mqtt/mqtt-config-panel" + ), + }, }, }; diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index a23adbd43f..962a4ab519 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -46,6 +46,10 @@ declare global { } const integrationsWithPanel = { + mqtt: { + buttonLocalizeKey: "ui.panel.config.mqtt.button", + path: "/config/mqtt", + }, zha: { buttonLocalizeKey: "ui.panel.config.zha.button", path: "/config/zha/dashboard", diff --git a/src/panels/developer-tools/mqtt/developer-tools-mqtt.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts similarity index 57% rename from src/panels/developer-tools/mqtt/developer-tools-mqtt.ts rename to src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index 5ed1c38b88..37a7d883de 100644 --- a/src/panels/developer-tools/mqtt/developer-tools-mqtt.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -9,13 +9,14 @@ import { property, TemplateResult, } from "lit-element"; -import "../../../components/ha-card"; -import "../../../components/ha-code-editor"; -import { haStyle } from "../../../resources/styles"; -import { HomeAssistant } from "../../../types"; +import "../../../../../components/ha-card"; +import "../../../../../components/ha-code-editor"; +import { haStyle } from "../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../types"; import "./mqtt-subscribe-card"; +import "../../../../../layouts/hass-subpage"; -@customElement("developer-tools-mqtt") +@customElement("mqtt-config-panel") class HaPanelDevMqtt extends LitElement { @property() public hass!: HomeAssistant; @@ -37,43 +38,41 @@ class HaPanelDevMqtt extends LitElement { protected render(): TemplateResult { return html` -
    - -
    - + +
    + +
    + -

    - ${this.hass.localize( - "ui.panel.developer-tools.tabs.mqtt.payload" - )} -

    - -
    -
    - ${this.hass.localize( - "ui.panel.developer-tools.tabs.mqtt.publish" - )} -
    -
    +

    + ${this.hass.localize("ui.panel.config.mqtt.payload")} +

    + +
    +
    + ${this.hass.localize( + "ui.panel.config.mqtt.publish" + )} +
    + - -
    + +
    + `; } diff --git a/src/panels/developer-tools/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts similarity index 80% rename from src/panels/developer-tools/mqtt/mqtt-subscribe-card.ts rename to src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index 0c65086c02..98652360fd 100644 --- a/src/panels/developer-tools/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -9,10 +9,10 @@ import { property, TemplateResult, } from "lit-element"; -import { formatTime } from "../../../common/datetime/format_time"; -import "../../../components/ha-card"; -import { MQTTMessage, subscribeMQTTTopic } from "../../../data/mqtt"; -import { HomeAssistant } from "../../../types"; +import { formatTime } from "../../../../../common/datetime/format_time"; +import "../../../../../components/ha-card"; +import { MQTTMessage, subscribeMQTTTopic } from "../../../../../data/mqtt"; +import { HomeAssistant } from "../../../../../types"; @customElement("mqtt-subscribe-card") class MqttSubscribeCard extends LitElement { @@ -43,18 +43,14 @@ class MqttSubscribeCard extends LitElement { return html`
    ${this._subscribed - ? this.hass.localize( - "ui.panel.developer-tools.tabs.mqtt.stop_listening" - ) - : this.hass.localize( - "ui.panel.developer-tools.tabs.mqtt.start_listening" - )} + ? this.hass.localize("ui.panel.config.mqtt.stop_listening") + : this.hass.localize("ui.panel.config.mqtt.start_listening")}
    @@ -78,7 +70,7 @@ class MqttSubscribeCard extends LitElement { (msg) => html`
    ${this.hass.localize( - "ui.panel.developer-tools.tabs.mqtt.message_received", + "ui.panel.config.mqtt.message_received", "id", msg.id, "topic", 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 a292ccab6f..8e28351bef 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 @@ -38,6 +38,10 @@ class HaConfigZwave extends LocalizeMixin(EventsMixin(PolymerElement)) { static get template() { return html`