Skip to content

Commit 7ab5b33

Browse files
Updating fake clock ticking function
1 parent 1b9b7cd commit 7ab5b33

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

hass-connect-fake/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,16 @@ function HassProvider({
437437
last_changed: now.toISOString(),
438438
last_updated: now.toISOString(),
439439
}
440-
entities['sensor.time'] = {
441-
...entities['sensor.time'],
442-
...dates,
443-
state: formatted
440+
if (formatted !== entities['sensor.time'].state) {
441+
setEntities({
442+
...entities,
443+
'sensor.time': {
444+
...entities['sensor.time'],
445+
...dates,
446+
state: formatted
447+
}
448+
});
444449
}
445-
setEntities(entities);
446450
}, 125);
447451
return () => {
448452
if (clock.current) clearInterval(clock.current);

0 commit comments

Comments
 (0)