+
`;
}
@@ -227,10 +245,10 @@ export class ScheduleEntityRow extends LitElement {
}
toggleDisabled(ev: Event) {
- if (!this.hass || !this.schedule) return;
+ if (!this.hass || !this._schedule) return;
ev.stopPropagation();
const checked = !(ev.target as HTMLInputElement).checked;
- this.hass!.callService('switch', checked ? 'turn_on' : 'turn_off', { entity_id: this.schedule.entity_id });
+ this.hass!.callService('switch', checked ? 'turn_on' : 'turn_off', { entity_id: this._schedule.entity_id });
}
static styles = css`
diff --git a/src/custom-elements/timeslot-editor.ts b/src/custom-elements/timeslot-editor.ts
index 193ddceb..d0586746 100755
--- a/src/custom-elements/timeslot-editor.ts
+++ b/src/custom-elements/timeslot-editor.ts
@@ -1,4 +1,4 @@
-import { LitElement, html, customElement, css, property, TemplateResult } from 'lit-element';
+import { LitElement, html, customElement, css, property, TemplateResult, eventOptions } from 'lit-element';
import { localize } from '../localize/localize';
import { ActionElement, EVariableType, LevelVariableConfig, ListVariableConfig, Timeslot } from '../types';
import { PrettyPrintName, unique } from '../helpers';
@@ -105,8 +105,9 @@ export class TimeslotEditor extends LitElement {
>
{ this._handleTouchStart(ev, i) }}"
- @touchstart="${(ev: MouseEvent | TouchEvent) => { this._handleTouchStart(ev, i) }}"
+ index="${i}"
+ @mousedown=${this._handleTouchStart}
+ @touchstart=${this._handleTouchStart}
>