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
16 changes: 16 additions & 0 deletions src/panels/config/customize/ha-config-customize.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "../ha-config-section";
import "../ha-entity-config";
import { configSections } from "../ha-panel-config";
import "./ha-form-customize";
import { documentationUrl } from "../../../util/documentation-url";

/*
* @appliesMixin LocalizeMixin
Expand All @@ -34,6 +35,14 @@ class HaConfigCustomize extends LocalizeMixin(PolymerElement) {
</span>
<span slot="introduction">
[[localize('ui.panel.config.customize.picker.introduction')]]
<br />
<a
href="[[_computeDocumentationUrl(hass)]]"
target="_blank"
rel="noreferrer"
>
[[localize("ui.panel.config.customize.picker.documentation")]]
</a>
</span>
<ha-entity-config
hass="[[hass]]"
Expand Down Expand Up @@ -91,5 +100,12 @@ class HaConfigCustomize extends LocalizeMixin(PolymerElement) {
.map((key) => hass.states[key])
.sort(sortStatesByName);
}

_computeDocumentationUrl(hass) {
return documentationUrl(
hass,
"/docs/configuration/customizing-devices/#customization-using-the-ui"
);
}
}
customElements.define("ha-config-customize", HaConfigCustomize);
16 changes: 8 additions & 8 deletions src/panels/config/customize/ha-form-customize.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,35 @@ class HaFormCustomize extends LocalizeMixin(PolymerElement) {
</div>
</template>
<template is="dom-if" if="[[hasLocalAttributes]]">
<h4 class="attributes-text">
<p class="attributes-text">
[[localize('ui.panel.config.customize.attributes_customize')]]<br />
</h4>
</p>
<ha-form-customize-attributes
attributes="{{localAttributes}}"
></ha-form-customize-attributes>
</template>
<template is="dom-if" if="[[hasGlobalAttributes]]">
<h4 class="attributes-text">
<p class="attributes-text">
[[localize('ui.panel.config.customize.attributes_outside')]]<br />
[[localize('ui.panel.config.customize.different_include')]]
</h4>
</p>
<ha-form-customize-attributes
attributes="{{globalAttributes}}"
></ha-form-customize-attributes>
</template>
<template is="dom-if" if="[[hasExistingAttributes]]">
<h4 class="attributes-text">
<p class="attributes-text">
[[localize('ui.panel.config.customize.attributes_set')]]<br />
[[localize('ui.panel.config.customize.attributes_override')]]
</h4>
</p>
<ha-form-customize-attributes
attributes="{{existingAttributes}}"
></ha-form-customize-attributes>
</template>
<template is="dom-if" if="[[hasNewAttributes]]">
<h4 class="attributes-text">
<p class="attributes-text">
[[localize('ui.panel.config.customize.attributes_not_set')]]
</h4>
</p>
<ha-form-customize-attributes
attributes="{{newAttributes}}"
></ha-form-customize-attributes>
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@
"picker": {
"header": "Customizations",
"introduction": "Tweak per-entity attributes. Added/edited customizations will take effect immediately. Removed customizations will take effect when the entity is updated.",
"documentation": "Customization documentation",
"entity": "Entity"
},
"warning": {
Expand Down