grzegorz914 / homebridge-denon-tv

Homebridge plugin for Denon/Marantz AV Receivers, publish as independent external platform accessory.
MIT License
70 stars 15 forks source link

fix: explicit generation resolution #226

Closed DonutEspresso closed 6 months ago

DonutEspresso commented 6 months ago

This fixes the truthy check which will always fail for legacy devices since generation: 0. If you have other preferences for checking/setting just let me know.

As an aside - I am testing this on a 2112-CI which came out in 2011. So far so good though I'm probably not testing every single feature I need. Would be happy to file another PR to update documentation if you're inclined to keep a list of known/compatible AVRs.

DonutEspresso commented 6 months ago

Updated - I wasn't sure if default values were backfilled before or after; let me know and I can change it to be a straight this.generation = config.generation if needed.

grzegorz914 commented 6 months ago

We can just use this.generation = config.generation || 0; in this case if config.generation is null, undefined, 0, or false always use 0, in other cases use config.generation.

grzegorz914 commented 6 months ago

I close this at this time and add this fix in next release.