Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _valueChanged(ev) {
if (!this._config || !this.hass) {
return;
}
const { target } = ev;
if (this[`_${target.configValue}`] === target.value) {
return;
}
if (target.configValue) {
this._config = {
...this._config,
[target.configValue]:
target.checked !== undefined ? target.checked : target.value,
};
}
fireEvent(this, 'config-changed', { config: this._config });
}