Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/ha-expansion-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class HaExpansionPanel extends LitElement {
var(--divider-color, #e0e0e0)
);
border-radius: var(--ha-card-border-radius, 4px);
padding: 0 8px;
}

.summary {
Expand All @@ -83,6 +84,7 @@ class HaExpansionPanel extends LitElement {
align-items: center;
cursor: pointer;
overflow: hidden;
font-weight: 500;
}

.summary-icon {
Expand Down
15 changes: 15 additions & 0 deletions src/panels/config/entities/dialog-entity-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ export class DialogEntityEditor extends LitElement {
>${this.hass.localize("ui.dialogs.entity_registry.faq")}</a
>`
)}
${this.hass.userData?.showAdvanced
? html`<br /><br />
${this.hass.localize(
"ui.dialogs.entity_registry.info_customize",
"customize_link",
html`<a
href="${"/config/customize/edit/" +
this._params!.entity_id}"
rel="noreferrer"
>${this.hass.localize(
"ui.dialogs.entity_registry.customize_link"
)}</a
>`
)}`
: ""}
</div>
`;
case "tab-related":
Expand Down
29 changes: 22 additions & 7 deletions src/panels/config/entities/entity-registry-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,37 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
</div>

${this.entry.device_id
? html`<ha-expansion-panel .header=${"Advanced"}>
? html`<ha-expansion-panel
.header=${this.hass.localize(
"ui.dialogs.entity_registry.editor.advanced"
)}
outlined
>
<p>
By default the entities of a device are in the same area as the
device. If you change the area of this entity, it will no longer
follow the area of the device.
${this.hass.localize(
"ui.dialogs.entity_registry.editor.area_note"
)}
</p>
${this._areaId
? html`<mwc-button @click=${this._clearArea}
>Follow device area</mwc-button
>${this.hass.localize(
"ui.dialogs.entity_registry.editor.follow_device_area"
)}</mwc-button
>`
: this._device
? html`<mwc-button @click=${this._openDeviceSettings}
>Change device area</mwc-button
>${this.hass.localize(
"ui.dialogs.entity_registry.editor.change_device_area"
)}</mwc-button
>`
: ""}
<ha-area-picker
.hass=${this.hass}
.value=${this._areaId}
.placeholder=${this._device?.area_id}
.label=${this.hass.localize(
"ui.dialogs.entity_registry.editor.area"
)}
@value-changed=${this._areaPicked}
></ha-area-picker
></ha-expansion-panel>`
Expand Down Expand Up @@ -377,11 +389,14 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
margin-right: 16px;
}
.row {
margin-top: 8px;
margin: 8px 0;
color: var(--primary-text-color);
display: flex;
align-items: center;
}
p {
margin: 8px 0;
}
`,
];
}
Expand Down
9 changes: 8 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@
"dismiss": "Dismiss",
"no_unique_id": "This entity (\"{entity_id}\") does not have a unique ID, therefore its settings cannot be managed from the UI. See the {faq_link} for more detail.",
"faq": "documentation",
"info_customize": "You can overwrite some attributes in the {customize_link} section.",
"customize_link": "entity customizations",
"editor": {
"name": "Name",
"icon": "Icon",
Expand All @@ -637,7 +639,12 @@
"delete": "Delete",
"confirm_delete": "Are you sure you want to delete this entry?",
"update": "Update",
"note": "Note: This might not work yet with all integrations."
"note": "Note: This might not work yet with all integrations.",
"advanced": "Advanced settings",
"area": "Set entity area only",
"area_note": "By default the entities of a device are in the same area as the device. If you change the area of this entity, it will no longer follow the area of the device.",
"follow_device_area": "Follow device area",
"change_device_area": "Change device area"
}
},
"helper_settings": {
Expand Down