Skip to content

Commit 7a466f3

Browse files
committed
Fix hide history and logbook
1 parent 25bf8b0 commit 7a466f3

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

custom-more-info.js

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/constants/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export const DESCRIPTION = 'Custom more-info for Home Assistant';
33
export const URL = 'https://github.com/Mariusthvdb/custom-more-info';
44

55
export const STYLES_PREFIX = 'custom_more_info';
6-
export const MAX_ATTEMPTS = 500;
7-
export const RETRY_DELAY = 50;
6+
export const MAX_ATTEMPTS = 100;
7+
export const RETRY_DELAY = 10;
88

99
export enum SELECTOR {
1010
HUI_VIEW = 'hui-view',

src/custom-more-info.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import {
2121
SELECTOR,
2222
ESCAPE_REG_EXP,
2323
ALL_FILTER,
24-
IGNORED_ATTRIBUTES
24+
IGNORED_ATTRIBUTES,
25+
MAX_ATTEMPTS,
26+
RETRY_DELAY
2527
} from '@constants';
2628
import {
2729
addStyle,
@@ -37,8 +39,8 @@ class CustomMoreInfo {
3739

3840
constructor() {
3941
this._selector = new HAQuerySelector({
40-
retries: 5,
41-
delay: 500
42+
retries: MAX_ATTEMPTS,
43+
delay: RETRY_DELAY
4244
});
4345
this._selector.addEventListener(HAQuerySelectorEvent.ON_LOVELACE_PANEL_LOAD, (event) => {
4446
this.storeConfig(event.detail);

src/utilities/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const getPromisableElement = <T>(
5151
let attempts = 0;
5252
const select = () => {
5353
const element: T = getElement();
54-
if (element && check(element)) {
54+
if (check(element)) {
5555
resolve(element);
5656
} else {
5757
attempts++;

0 commit comments

Comments
 (0)