From 90f4d8980cabe496383f5f807e001722b00afda9 Mon Sep 17 00:00:00 2001 From: Erik Baauw Date: Fri, 10 May 2024 16:34:48 +0200 Subject: [PATCH] Code cleanup --- index.js | 2 -- lib/WsPlatform.js | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index d0d9701..16a3744 100644 --- a/index.js +++ b/index.js @@ -3,8 +3,6 @@ // // Homebridge plugin for virtual weather station. -'use strict' - import { createRequire } from 'node:module' import { WsPlatform } from './lib/WsPlatform.js' diff --git a/lib/WsPlatform.js b/lib/WsPlatform.js index aac1517..d9dc843 100644 --- a/lib/WsPlatform.js +++ b/lib/WsPlatform.js @@ -3,9 +3,7 @@ // // Homebridge plugin for virtual weather station. -'use strict' - -import events from 'events' +import { once } from 'node:events' import { HttpClient } from 'homebridge-lib/HttpClient' import { OptionParser } from 'homebridge-lib/OptionParser' @@ -132,7 +130,7 @@ class WsPlatform extends Platform { hourlyForecasts: this.config.hourlyForecasts } const wsAccessory = new WsAccessory(this, params) - jobs.push(events.once(wsAccessory, 'initialised')) + jobs.push(once(wsAccessory, 'initialised')) this.wsAccessories[name] = wsAccessory } catch (error) { this.error(error)