Fix include domains on entity picker (#5615)

This commit is contained in:
Bram Kragten 2020-04-24 13:36:10 +02:00 committed by GitHub
parent bf55be7f7f
commit 14330fbd93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 45 additions and 15 deletions

View File

@ -6,6 +6,8 @@ import { PolymerChangedEvent } from "../../../../../polymer-types";
import { HomeAssistant } from "../../../../../types"; import { HomeAssistant } from "../../../../../types";
import { ActionElement } from "../ha-automation-action-row"; import { ActionElement } from "../ha-automation-action-row";
const includeDomains = ["scene"];
@customElement("ha-automation-action-scene") @customElement("ha-automation-action-scene")
export class HaSceneAction extends LitElement implements ActionElement { export class HaSceneAction extends LitElement implements ActionElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@ -24,7 +26,7 @@ export class HaSceneAction extends LitElement implements ActionElement {
.hass=${this.hass} .hass=${this.hass}
.value=${scene} .value=${scene}
@value-changed=${this._entityPicked} @value-changed=${this._entityPicked}
include-domains="['scene']" .includeDomains=${includeDomains}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>
`; `;

View File

@ -12,6 +12,8 @@ function zoneAndLocationFilter(stateObj) {
return hasLocation(stateObj) && computeStateDomain(stateObj) !== "zone"; return hasLocation(stateObj) && computeStateDomain(stateObj) !== "zone";
} }
const includeDomains = ["zone"];
@customElement("ha-automation-condition-zone") @customElement("ha-automation-condition-zone")
export class HaZoneCondition extends LitElement { export class HaZoneCondition extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@ -46,7 +48,7 @@ export class HaZoneCondition extends LitElement {
@value-changed=${this._zonePicked} @value-changed=${this._zonePicked}
.hass=${this.hass} .hass=${this.hass}
allow-custom-entity allow-custom-entity
include-domains="['zone']" .includeDomains=${includeDomains}
></ha-entity-picker> ></ha-entity-picker>
<label id="eventlabel"> <label id="eventlabel">
${this.hass.localize( ${this.hass.localize(

View File

@ -8,6 +8,8 @@ import type { GeoLocationTrigger } from "../../../../../data/automation";
import type { HomeAssistant } from "../../../../../types"; import type { HomeAssistant } from "../../../../../types";
import { handleChangeEvent } from "../ha-automation-trigger-row"; import { handleChangeEvent } from "../ha-automation-trigger-row";
const includeDomains = ["zone"];
@customElement("ha-automation-trigger-geo_location") @customElement("ha-automation-trigger-geo_location")
export default class HaGeolocationTrigger extends LitElement { export default class HaGeolocationTrigger extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@ -42,7 +44,7 @@ export default class HaGeolocationTrigger extends LitElement {
@value-changed=${this._zonePicked} @value-changed=${this._zonePicked}
.hass=${this.hass} .hass=${this.hass}
allow-custom-entity allow-custom-entity
include-domains="['zone']" .includeDomains=${includeDomains}
></ha-entity-picker> ></ha-entity-picker>
<label id="eventlabel"> <label id="eventlabel">
${this.hass.localize( ${this.hass.localize(

View File

@ -14,6 +14,8 @@ function zoneAndLocationFilter(stateObj) {
return hasLocation(stateObj) && computeStateDomain(stateObj) !== "zone"; return hasLocation(stateObj) && computeStateDomain(stateObj) !== "zone";
} }
const includeDomains = ["zone"];
@customElement("ha-automation-trigger-zone") @customElement("ha-automation-trigger-zone")
export class HaZoneTrigger extends LitElement { export class HaZoneTrigger extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@ -49,7 +51,7 @@ export class HaZoneTrigger extends LitElement {
@value-changed=${this._zonePicked} @value-changed=${this._zonePicked}
.hass=${this.hass} .hass=${this.hass}
allow-custom-entity allow-custom-entity
include-domains="['zone']" .includeDomains=${includeDomains}
></ha-entity-picker> ></ha-entity-picker>
<label id="eventlabel"> <label id="eventlabel">
${this.hass.localize( ${this.hass.localize(

View File

@ -18,6 +18,8 @@ import { haStyleDialog } from "../../../resources/styles";
import { HomeAssistant } from "../../../types"; import { HomeAssistant } from "../../../types";
import { PersonDetailDialogParams } from "./show-dialog-person-detail"; import { PersonDetailDialogParams } from "./show-dialog-person-detail";
const includeDomains = ["device_tracker"];
class DialogPersonDetail extends LitElement { class DialogPersonDetail extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@ -106,7 +108,7 @@ class DialogPersonDetail extends LitElement {
<ha-entities-picker <ha-entities-picker
.hass=${this.hass} .hass=${this.hass}
.value=${this._deviceTrackers} .value=${this._deviceTrackers}
.include-domains=${["device_tracker"]} .includeDomains=${includeDomains}
.pickedEntityLabel=${this.hass.localize( .pickedEntityLabel=${this.hass.localize(
"ui.panel.config.person.detail.device_tracker_picked" "ui.panel.config.person.detail.device_tracker_picked"
)} )}

View File

@ -29,6 +29,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["alarm_control_panel"];
@customElement("hui-alarm-panel-card-editor") @customElement("hui-alarm-panel-card-editor")
export class HuiAlarmPanelCardEditor extends LitElement export class HuiAlarmPanelCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -76,7 +78,7 @@ export class HuiAlarmPanelCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["alarm_control_panel"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -30,6 +30,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["sensor"];
@customElement("hui-gauge-card-editor") @customElement("hui-gauge-card-editor")
export class HuiGaugeCardEditor extends LitElement export class HuiGaugeCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -87,7 +89,7 @@ export class HuiGaugeCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["sensor"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -34,6 +34,8 @@ const cardConfigStruct = struct({
double_tap_action: struct.optional(actionConfigStruct), double_tap_action: struct.optional(actionConfigStruct),
}); });
const includeDomains = ["light"];
@customElement("hui-light-card-editor") @customElement("hui-light-card-editor")
export class HuiLightCardEditor extends LitElement export class HuiLightCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -95,7 +97,7 @@ export class HuiLightCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value=${this._entity} .value=${this._entity}
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["light"]} .includeDomains=${includeDomains}
@change=${this._valueChanged} @change=${this._valueChanged}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -18,6 +18,8 @@ const cardConfigStruct = struct({
entity: "string?", entity: "string?",
}); });
const includeDomains = ["media_player"];
@customElement("hui-media-control-card-editor") @customElement("hui-media-control-card-editor")
export class HuiMediaControlCardEditor extends LitElement export class HuiMediaControlCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -50,7 +52,7 @@ export class HuiMediaControlCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["media_player"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -41,6 +41,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["camera"];
@customElement("hui-picture-entity-card-editor") @customElement("hui-picture-entity-card-editor")
export class HuiPictureEntityCardEditor extends LitElement export class HuiPictureEntityCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -150,7 +152,7 @@ export class HuiPictureEntityCardEditor extends LitElement
.value="${this._camera_image}" .value="${this._camera_image}"
.configValue=${"camera_image"} .configValue=${"camera_image"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
.include-domains=${["camera"]} .includeDomains=${includeDomains}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>
<div class="side-by-side"> <div class="side-by-side">

View File

@ -43,6 +43,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["camera"];
@customElement("hui-picture-glance-card-editor") @customElement("hui-picture-glance-card-editor")
export class HuiPictureGlanceCardEditor extends LitElement export class HuiPictureGlanceCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -150,7 +152,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
.configValue=${"camera_image"} .configValue=${"camera_image"}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
.include-domains=${["camera"]} .includeDomains=${includeDomains}
></ha-entity-picker> ></ha-entity-picker>
<div class="side-by-side"> <div class="side-by-side">
<paper-dropdown-menu <paper-dropdown-menu

View File

@ -24,6 +24,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["plant"];
@customElement("hui-plant-status-card-editor") @customElement("hui-plant-status-card-editor")
export class HuiPlantStatusCardEditor extends LitElement export class HuiPlantStatusCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -65,7 +67,7 @@ export class HuiPlantStatusCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["plant"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -33,6 +33,8 @@ const cardConfigStruct = struct({
hours_to_show: "number?", hours_to_show: "number?",
}); });
const includeDomains = ["sensor"];
@customElement("hui-sensor-card-editor") @customElement("hui-sensor-card-editor")
export class HuiSensorCardEditor extends LitElement export class HuiSensorCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -96,7 +98,7 @@ export class HuiSensorCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["sensor"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -23,6 +23,8 @@ const cardConfigStruct = struct({
theme: "string?", theme: "string?",
}); });
const includeDomains = ["climate"];
@customElement("hui-thermostat-card-editor") @customElement("hui-thermostat-card-editor")
export class HuiThermostatCardEditor extends LitElement export class HuiThermostatCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -64,7 +66,7 @@ export class HuiThermostatCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value="${this._entity}" .value="${this._entity}"
.configValue=${"entity"} .configValue=${"entity"}
.include-domains=${["climate"]} .includeDomains=${includeDomains}
@change="${this._valueChanged}" @change="${this._valueChanged}"
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>

View File

@ -25,6 +25,8 @@ const cardConfigStruct = struct({
show_forecast: "boolean?", show_forecast: "boolean?",
}); });
const includeDomains = ["weather"];
@customElement("hui-weather-forecast-card-editor") @customElement("hui-weather-forecast-card-editor")
export class HuiWeatherForecastCardEditor extends LitElement export class HuiWeatherForecastCardEditor extends LitElement
implements LovelaceCardEditor { implements LovelaceCardEditor {
@ -70,7 +72,7 @@ export class HuiWeatherForecastCardEditor extends LitElement
.hass=${this.hass} .hass=${this.hass}
.value=${this._entity} .value=${this._entity}
.configValue=${"entity"} .configValue=${"entity"}
.includeDomains=${["weather"]} .includeDomains=${includeDomains}
@change=${this._valueChanged} @change=${this._valueChanged}
allow-custom-entity allow-custom-entity
></ha-entity-picker> ></ha-entity-picker>