mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Add settings shortcut to scene and script table (#20375)
This commit is contained in:
parent
92f6083e0b
commit
d52afc3f71
@ -2,6 +2,7 @@ import { consume } from "@lit-labs/context";
|
|||||||
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
||||||
import {
|
import {
|
||||||
mdiChevronRight,
|
mdiChevronRight,
|
||||||
|
mdiCog,
|
||||||
mdiContentDuplicate,
|
mdiContentDuplicate,
|
||||||
mdiDelete,
|
mdiDelete,
|
||||||
mdiDotsVertical,
|
mdiDotsVertical,
|
||||||
@ -82,6 +83,7 @@ import {
|
|||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../../dialogs/generic/show-dialog-box";
|
} from "../../../dialogs/generic/show-dialog-box";
|
||||||
|
import { showMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
|
||||||
import "../../../layouts/hass-tabs-subpage-data-table";
|
import "../../../layouts/hass-tabs-subpage-data-table";
|
||||||
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
||||||
import { haStyle } from "../../../resources/styles";
|
import { haStyle } from "../../../resources/styles";
|
||||||
@ -283,6 +285,13 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
|
|||||||
),
|
),
|
||||||
action: () => this._showInfo(scene),
|
action: () => this._showInfo(scene),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: mdiCog,
|
||||||
|
label: this.hass.localize(
|
||||||
|
"ui.panel.config.automation.picker.show_settings"
|
||||||
|
),
|
||||||
|
action: () => this._openSettings(scene),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: mdiPlay,
|
path: mdiPlay,
|
||||||
label: this.hass.localize(
|
label: this.hass.localize(
|
||||||
@ -815,6 +824,13 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
|
|||||||
fireEvent(this, "hass-more-info", { entityId: scene.entity_id });
|
fireEvent(this, "hass-more-info", { entityId: scene.entity_id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _openSettings(scene: SceneEntity) {
|
||||||
|
showMoreInfoDialog(this, {
|
||||||
|
entityId: scene.entity_id,
|
||||||
|
view: "settings",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private _activateScene = async (scene: SceneEntity) => {
|
private _activateScene = async (scene: SceneEntity) => {
|
||||||
await activateScene(this.hass, scene.entity_id);
|
await activateScene(this.hass, scene.entity_id);
|
||||||
showToast(this, {
|
showToast(this, {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { consume } from "@lit-labs/context";
|
import { consume } from "@lit-labs/context";
|
||||||
import {
|
import {
|
||||||
mdiChevronRight,
|
mdiChevronRight,
|
||||||
|
mdiCog,
|
||||||
mdiContentDuplicate,
|
mdiContentDuplicate,
|
||||||
mdiDelete,
|
mdiDelete,
|
||||||
mdiDotsVertical,
|
mdiDotsVertical,
|
||||||
@ -83,6 +84,7 @@ import {
|
|||||||
showAlertDialog,
|
showAlertDialog,
|
||||||
showConfirmationDialog,
|
showConfirmationDialog,
|
||||||
} from "../../../dialogs/generic/show-dialog-box";
|
} from "../../../dialogs/generic/show-dialog-box";
|
||||||
|
import { showMoreInfoDialog } from "../../../dialogs/more-info/show-ha-more-info-dialog";
|
||||||
import "../../../layouts/hass-tabs-subpage-data-table";
|
import "../../../layouts/hass-tabs-subpage-data-table";
|
||||||
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
||||||
import { haStyle } from "../../../resources/styles";
|
import { haStyle } from "../../../resources/styles";
|
||||||
@ -294,6 +296,13 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
|
|||||||
),
|
),
|
||||||
action: () => this._showInfo(script),
|
action: () => this._showInfo(script),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: mdiCog,
|
||||||
|
label: this.hass.localize(
|
||||||
|
"ui.panel.config.automation.picker.show_settings"
|
||||||
|
),
|
||||||
|
action: () => this._openSettings(script),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: mdiTag,
|
path: mdiTag,
|
||||||
label: this.hass.localize(
|
label: this.hass.localize(
|
||||||
@ -895,6 +904,13 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
|
|||||||
fireEvent(this, "hass-more-info", { entityId: script.entity_id });
|
fireEvent(this, "hass-more-info", { entityId: script.entity_id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _openSettings(script: any) {
|
||||||
|
showMoreInfoDialog(this, {
|
||||||
|
entityId: script.entity_id,
|
||||||
|
view: "settings",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private _showTrace(script: any) {
|
private _showTrace(script: any) {
|
||||||
const entry = this.entityRegistry.find(
|
const entry = this.entityRegistry.find(
|
||||||
(e) => e.entity_id === script.entity_id
|
(e) => e.entity_id === script.entity_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user