Skip to content

Commit

Permalink
fix: Notification error and new events lib
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed Jul 22, 2021
1 parent 329024b commit 52421b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 19 deletions.
40 changes: 25 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
"test": "eslint ./src/*.ts"
},
"dependencies": {
"@svrooij/sonos": "2.4.0",
"@svrooij/sonos": "^2.4.1-beta.5",
"mqtt": "4.2.8",
"serilogger": "^0.3.1",
"strict-event-emitter-types": "^2.0.0",
"yalm": "4.1.0",
"yargs": "16.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/smarthome-mqtt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mqtt, { IClientPublishOptions } from 'mqtt'
import { MqttClient } from 'mqtt'
import {StrictEventEmitter} from 'strict-event-emitter-types'
import TypedEmitter from 'typed-emitter';
import {EventEmitter} from 'events'
import { DeviceControl } from './device-control'
import {StaticLogger} from './static-logger'
Expand All @@ -15,7 +15,7 @@ export class SmarthomeMqtt{
private readonly log = StaticLogger.CreateLoggerForSource('sonos2mqtt.SmarthomeMqtt')
private readonly uri: URL
private mqttClient?: MqttClient;
public readonly Events: StrictEventEmitter<EventEmitter, MqttEvents> = new EventEmitter();
public readonly Events: TypedEmitter<MqttEvents> = new EventEmitter();
constructor(mqttUrl: string, private readonly prefix: string = 'sonos', private readonly clientId?: string) {
this.uri = new URL(mqttUrl)
}
Expand Down

0 comments on commit 52421b7

Please sign in to comment.