Skip to content

Commit 886d79b

Browse files
committed
fix ping integration expectation when saving settings
1 parent b4d4714 commit 886d79b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dist/kobold-alarm-clock-card.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/kobold-alarm-clock-card.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/alarm-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export class AlarmController {
278278
replace_attributes: true
279279
};
280280

281-
if (this.alarmClockPingEntity.state === 'on') {
281+
if (this.alarmClockPingEntity?.state === 'on' || !this.alarmClockPingEntity) {
282282
this._hass.callService('variable', 'update_sensor', param);
283283
this._controllersAlarmConfig = Object.assign(new AlarmConfiguration, configurationWithLastUpdated);
284284
} else {

src/kobold-alarm-clock-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ class KoboldAlarmClockCard extends LitElement {
11331133
_updateTime(force = false) {
11341134

11351135
this._alarmController.evaluateAlarms();
1136-
const fontNum = (!this._alarmController.alarmClockPingEntity || this._alarmController.alarmClockPingEntity.state === 'off' || !this._alarmConfiguration['clockFontFace']) ? '0' : this._alarmConfiguration['clockFontFace'];
1136+
const fontNum = (this._alarmController.alarmClockPingEntity && this._alarmController.alarmClockPingEntity.state === 'off' || !this._alarmConfiguration['clockFontFace']) ? '0' : this._alarmConfiguration['clockFontFace'];
11371137
const fontFaceClass = 'fontFace' + fontNum;
11381138
this._clockClasses = fontNum === '0' ? { clock: true } : { clock: true, [fontFaceClass]: true };
11391139
const time = dayjs().format(this._alarmConfiguration['timeFormat'] === '24hr' ? 'HH:mm' : 'h:mm A');

0 commit comments

Comments
 (0)