Skip to content

Commit

Permalink
fix: Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Oct 27, 2021
1 parent d023c67 commit 3bb743d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/homeAssistant/Websocket.ts
Expand Up @@ -470,7 +470,7 @@ export default class Websocket {
}

close(): void {
typeof this.stopHeartbeat === 'function' && this.stopHeartbeat();
if (typeof this.stopHeartbeat === 'function') this.stopHeartbeat();
this?.client?.close();
}

Expand Down
4 changes: 1 addition & 3 deletions src/homeAssistant/heartbeat.ts
@@ -1,5 +1,4 @@
import Debug from 'debug';

import { Connection } from 'home-assistant-js-websocket';

const debug = Debug('home-assistant:ws:heartbeat');
Expand All @@ -14,10 +13,9 @@ export const startHeartbeat = (
interval: number,
host: string
): StopHeartbeat => {
let heartbeatIntervalId: NodeJS.Timer;
let beatTimeoutId: NodeJS.Timeout;

heartbeatIntervalId = setInterval(
const heartbeatIntervalId = setInterval(
async () => {
beatTimeoutId = setTimeout(() => {
debug(`No pong received from ${host} attempting to reconnect`);
Expand Down

0 comments on commit 3bb743d

Please sign in to comment.