Entity registry: Translate advanced section + direct link to entity customization (#8181)

This commit is contained in:
Philip Allgaier 2021-01-27 12:35:25 +01:00 committed by GitHub
parent 8bfe583a20
commit 8d0608610f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 8 deletions

View File

@ -74,6 +74,7 @@ class HaExpansionPanel extends LitElement {
var(--divider-color, #e0e0e0)
);
border-radius: var(--ha-card-border-radius, 4px);
padding: 0 8px;
}
.summary {
@ -83,6 +84,7 @@ class HaExpansionPanel extends LitElement {
align-items: center;
cursor: pointer;
overflow: hidden;
font-weight: 500;
}
.summary-icon {

View File

@ -184,6 +184,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":

View File

@ -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>`
@ -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;
}
`,
];
}

View File

@ -625,6 +625,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",
@ -641,7 +643,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": {