mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Do not display no areas in entity pickers (#25317)
This commit is contained in:
parent
fb3a59272d
commit
4ec5fbc9a4
@ -314,9 +314,7 @@ export class HaEntityComboBox extends LitElement {
|
|||||||
...hass!.states[entityId],
|
...hass!.states[entityId],
|
||||||
label: "",
|
label: "",
|
||||||
primary: primary,
|
primary: primary,
|
||||||
secondary:
|
secondary: secondary,
|
||||||
secondary ||
|
|
||||||
this.hass.localize("ui.components.device-picker.no_area"),
|
|
||||||
translated_domain: translatedDomain,
|
translated_domain: translatedDomain,
|
||||||
sorting_label: [deviceName, entityName].filter(Boolean).join("-"),
|
sorting_label: [deviceName, entityName].filter(Boolean).join("-"),
|
||||||
entity_name: entityName || deviceName,
|
entity_name: entityName || deviceName,
|
||||||
|
@ -162,10 +162,7 @@ export class HaEntityPicker extends LitElement {
|
|||||||
slot="start"
|
slot="start"
|
||||||
></state-badge>
|
></state-badge>
|
||||||
<span slot="headline">${primary}</span>
|
<span slot="headline">${primary}</span>
|
||||||
<span slot="supporting-text">
|
<span slot="supporting-text">${secondary}</span>
|
||||||
${secondary ||
|
|
||||||
this.hass.localize("ui.components.device-picker.no_area")}
|
|
||||||
</span>
|
|
||||||
${showClearIcon
|
${showClearIcon
|
||||||
? html`<ha-icon-button
|
? html`<ha-icon-button
|
||||||
class="clear"
|
class="clear"
|
||||||
|
@ -358,6 +358,7 @@ export class QuickBar extends LitElement {
|
|||||||
private _renderDeviceItem(item: DeviceItem, index?: number) {
|
private _renderDeviceItem(item: DeviceItem, index?: number) {
|
||||||
return html`
|
return html`
|
||||||
<ha-md-list-item
|
<ha-md-list-item
|
||||||
|
class="two-line"
|
||||||
.item=${item}
|
.item=${item}
|
||||||
index=${ifDefined(index)}
|
index=${ifDefined(index)}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@ -376,6 +377,7 @@ export class QuickBar extends LitElement {
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-md-list-item
|
<ha-md-list-item
|
||||||
|
class=${showEntityId ? "three-line" : "two-line"}
|
||||||
.item=${item}
|
.item=${item}
|
||||||
index=${ifDefined(index)}
|
index=${ifDefined(index)}
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@ -621,9 +623,7 @@ export class QuickBar extends LitElement {
|
|||||||
|
|
||||||
const entityItem = {
|
const entityItem = {
|
||||||
primaryText: primary,
|
primaryText: primary,
|
||||||
altText:
|
altText: secondary,
|
||||||
secondary ||
|
|
||||||
this.hass.localize("ui.components.device-picker.no_area"),
|
|
||||||
icon: html`
|
icon: html`
|
||||||
<ha-state-icon
|
<ha-state-icon
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -1021,6 +1021,23 @@ export class QuickBar extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Fixed height for items because we are use virtualizer */
|
||||||
|
ha-md-list-item.two-line {
|
||||||
|
--md-list-item-one-line-container-height: 64px;
|
||||||
|
--md-list-item-two-line-container-height: 64px;
|
||||||
|
--md-list-item-top-space: 8px;
|
||||||
|
--md-list-item-bottom-space: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ha-md-list-item.three-line {
|
||||||
|
width: 100%;
|
||||||
|
--md-list-item-one-line-container-height: 72px;
|
||||||
|
--md-list-item-two-line-container-height: 72px;
|
||||||
|
--md-list-item-three-line-container-height: 72px;
|
||||||
|
--md-list-item-top-space: 8px;
|
||||||
|
--md-list-item-bottom-space: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
ha-tip {
|
ha-tip {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user