Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Clooos authored Oct 10, 2023
1 parent 3e71e0f commit 00d22e5
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/bubble-card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var version = 'v1.1.1';
var version = 'v1.1.2';

let editor;

Expand Down Expand Up @@ -2063,6 +2063,7 @@ class BubbleCardEditor extends LitElement {
style="width: 50%;"
></ha-slider>
</div>
<ha-alert alert-type="info">You can't set a value to 0 with the sliders for now, just change it to 0 in the text field if you need to.</ha-alert>
<h3>Advanced settings</h3>
<ha-formfield .label="Optional - Back button/event support">
<ha-switch
Expand Down Expand Up @@ -2405,6 +2406,24 @@ class BubbleCardEditor extends LitElement {
});
}

// Working for sliders but add more issues, to be fixed
// _valueChanged(ev) {
// if (!this._config || !this.hass) {
// return;
// }
// const target = ev.target;
// const detail = ev.detail;
// if (target.configValue) {
// this._config = {
// ...this._config,
// [target.configValue]: target.value !== undefined ? target.value : (target.checked !== undefined ? target.checked : detail.value),
// }
// }
// fireEvent(this, "config-changed", {
// config: this._config
// });
// }

_valueChanged(ev) {
if (!this._config || !this.hass) {
return;
Expand All @@ -2414,7 +2433,7 @@ class BubbleCardEditor extends LitElement {
if (target.configValue) {
this._config = {
...this._config,
[target.configValue]: target.value !== undefined ? target.value : (target.checked !== undefined ? target.checked : detail.value),
[target.configValue]: target.checked !== undefined || !detail.value ? target.value || target.checked : target.checked || detail.value,
}
}
fireEvent(this, "config-changed", {
Expand Down

0 comments on commit 00d22e5

Please sign in to comment.