mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix more info remote (#19575)
This commit is contained in:
parent
767b2b6b9c
commit
73460c7d8a
@ -1,6 +1,6 @@
|
|||||||
import "@material/mwc-list/mwc-list";
|
import "@material/mwc-select/mwc-select";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
import "@material/mwc-list/mwc-list-item";
|
||||||
import { html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
import { stopPropagation } from "../../../common/dom/stop_propagation";
|
||||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
import { supportsFeature } from "../../../common/entity/supports-feature";
|
||||||
@ -26,17 +26,17 @@ class MoreInfoRemote extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
${supportsFeature(stateObj, REMOTE_SUPPORT_ACTIVITY)
|
${supportsFeature(stateObj, REMOTE_SUPPORT_ACTIVITY)
|
||||||
? html`
|
? html`
|
||||||
<mwc-list
|
<mwc-select
|
||||||
.label=${this.hass!.localize(
|
.label=${this.hass!.localize(
|
||||||
"ui.dialogs.more_info_control.remote.activity"
|
"ui.dialogs.more_info_control.remote.activity"
|
||||||
)}
|
)}
|
||||||
.value=${stateObj.attributes.current_activity}
|
.value=${stateObj.attributes.current_activity || ""}
|
||||||
@selected=${this.handleActivityChanged}
|
@selected=${this._handleActivityChanged}
|
||||||
fixedMenuPosition
|
fixedMenuPosition
|
||||||
naturalMenuWidth
|
naturalMenuWidth
|
||||||
@closed=${stopPropagation}
|
@closed=${stopPropagation}
|
||||||
>
|
>
|
||||||
${stateObj.attributes.activity_list!.map(
|
${stateObj.attributes.activity_list?.map(
|
||||||
(activity) => html`
|
(activity) => html`
|
||||||
<mwc-list-item .value=${activity}>
|
<mwc-list-item .value=${activity}>
|
||||||
${this.hass.formatEntityAttributeValue(
|
${this.hass.formatEntityAttributeValue(
|
||||||
@ -47,7 +47,7 @@ class MoreInfoRemote extends LitElement {
|
|||||||
</mwc-list-item>
|
</mwc-list-item>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</mwc-list>
|
</mwc-select>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class MoreInfoRemote extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleActivityChanged(ev) {
|
private _handleActivityChanged(ev) {
|
||||||
const oldVal = this.stateObj!.attributes.current_activity;
|
const oldVal = this.stateObj!.attributes.current_activity;
|
||||||
const newVal = ev.target.value;
|
const newVal = ev.target.value;
|
||||||
|
|
||||||
@ -72,6 +72,12 @@ class MoreInfoRemote extends LitElement {
|
|||||||
activity: newVal,
|
activity: newVal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
mwc-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user