Skip to content

Commit

Permalink
fix: Do not reset state to initial default state on unsupported messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbo2002 committed Jan 15, 2024
1 parent 4dd8992 commit 876c9b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/device-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export default class NodePyATVDeviceEvents extends EventEmitter {
keys = ['volume'];
}

// If all values are null, we don't need to emit events at all
// https://github.com/sebbo2002/node-pyatv/issues/295#issuecomment-1888640079
if(!Object.entries(newState).find(([k, v]) => !['result', 'dateTime'].includes(k) && v !== null)) {
return;
}

keys.forEach((key: string) => {

// @ts-ignore
Expand Down

0 comments on commit 876c9b4

Please sign in to comment.