Skip to content

Commit

Permalink
fix 2022.3 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
regevbr committed Mar 8, 2022
1 parent 940f80a commit 0ab8eb4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/light-entity-card.js

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions src/index-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import style from './style-editor';
import defaultConfig from './defaults';
import buildElementDefinitions from './buildElementDefinitions';
import haLoader from './haLoader';
import MwcListItem from './mwc/list-item';
import MwcSelect from './mwc/select';

export const fireEvent = (node, type, detail = {}, options = {}) => {
const event = new Event(type, {
Expand All @@ -23,6 +25,8 @@ export default class LightEntityCardEditor extends ScopedRegistryHost(LitElement
haLoader('ha-checkbox'),
haLoader('ha-formfield'),
haLoader('ha-form-string'),
MwcListItem,
MwcSelect,
], LightEntityCardEditor);
}

Expand Down Expand Up @@ -69,7 +73,7 @@ export default class LightEntityCardEditor extends ScopedRegistryHost(LitElement

// eslint-disable-next-line arrow-body-style
// eslint-disable-next-line arrow-parens
const options = this.entityOptions.map(entity => html`<paper-item>${entity}</paper-item>`);
const options = this.entityOptions.map(entity => html`<mwc-list-item value="${entity}" ?selected=${entity === this._config.entity}>${entity}</mwc-list-item>`);

return html`
<div class="card-config">
Expand All @@ -84,18 +88,13 @@ export default class LightEntityCardEditor extends ScopedRegistryHost(LitElement
</div>
<div class='entities'>
<paper-dropdown-menu
<mwc-select
label="Entity"
@value-changed="${this.configChanged}"
@selected="${this.configChanged}"
.configValue="${'entity'}"
>
<paper-listbox
slot="dropdown-content"
.selected="${this.entityOptions.indexOf(this._config.entity)}"
>
${options}
</paper-listbox>
</paper-dropdown-menu>
${options}
</mwc-select>
<ha-form-string
label="Brightness Icon"
.data="${this._config.brightness_icon}"
Expand Down
4 changes: 2 additions & 2 deletions src/style-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const style = css`
}
.checkbox-options ha-formfield,
.entities paper-dropdown-menu,
.entities paper-input {
.entities mwc-switch,
.entities ha-form-string {
padding-right: 2%;
width: 48%;
}
Expand Down
8 changes: 1 addition & 7 deletions src/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ const style = css`
width: 50%;
margin: 0 auto;
}
ha-labeled-slider {
--paper-slider-input: {
width: 100%;
}
}
.light-entity-card-color_temp {
background-image: var(--ha-slider-background);
}
Expand Down

0 comments on commit 0ab8eb4

Please sign in to comment.