-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): incorrect state tracking #291
Conversation
I assume that's the same issue as reported in sebbo2002/pyatv-mqtt-bridge#285. I assume the output you posted above is complete? I would like to solve this as in sebbo2002/pyatv-mqtt-bridge#285 (comment) and not based on the current state. This should prevent broken states from being created. Thanks for posting such an event, I wasn't able to reproduce this, please give me some days to fix this. |
The current state of a device was not taken into consideration when generating the updated state after receiving an update from atvscript. This way, attributes that are not reported in that specific result of atvscript, default to null, which is unwanted since in reality they are still unchanged. E.g. when changing the volume, all attributes beside the volume are set to null, since the volume attribute is the only one reported by atvscript when changing the volume.
Hi @sebbo2002, thanks for the fast reply. The output that I have posted above is a complete JSON response from |
No problem. Another question: Is the |
|
Though, I cannot speak for HDMI CEC because my HiFi setup is a bit oldschool. For testing, I selected a HomePod Mini as the default speaker. But I suppose reporting the volume will be the same for HDMI CEC devices. |
Yes, I would just assume that too. Thank you, I'll let you know when I have something. |
🎉 This issue has been resolved in version 7.2.1-develop.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@maxileith Hey, can you check if |
It works. Thanks for the fast fix! |
## [7.2.1](v7.2.0...v7.2.1) (2023-12-29) ### Bug Fixes * **DeviceEvents:** Handle power_state/focus_state/volume events properly ([48010f3](48010f3)), closes [/github.com/sebbo2002/pyatv-mqtt-bridge/issues/285#issuecomment-1797978006](https://github.com//github.com/sebbo2002/pyatv-mqtt-bridge/issues/285/issues/issuecomment-1797978006) [#291](#291)
🎉 This issue has been resolved in version 7.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi,
I think I found a major bug in this otherwise awesome library.
The current state of a device was not taken into consideration when generating the updated state after receiving an update from
atvscript
. This way, attributes that are not reported in that specific result ofatvscript
, default tonull
, which is unwanted since in reality they are still unchanged and notnull
.E.g. when changing the volume, all attributes beside the volume are set to
null
, since the volume attribute is the only one reported by atvscript when changing the volume:All attributes beside
volume
will default tonull
resulting in a wrong state and unnecessary event listener triggers:https://github.com/sebbo2002/node-pyatv/blob/65cbc62b8e65e85c6f82a0474d4dfb91c6663eeb/src/lib/tools.ts#L239C4-L239C4
About this Pull Request
Pull Request Checklist
npm run lint
to double checknpm run test
to run the unit tests andnpm run coverage
to generate a coverage report