Closed claytono closed 5 years ago
Ohhh, of course! This explains everything. I used to use:
if values and values['name'] ...
to overcome that error, but never went on the hunt for the root cause.
As far as I can see, this would cause the blacklist as a whole to never work, as any blacklisted pokemon wouldn't scan, which would result in CALCY_SCAN_INVALID and not CALCY_SUCCESS. At best we would only be able to blacklist pokemon that scan successfully - which makes no sense.
For reference, Calcy picks up name using the candy type and total HP, which do not get obscured and should always be readable.
If you're getting ValueErrors when referencing values['name'] I would suggest a patch to check if 'name' in values and values['name'] in self.config['blacklist'] feel free to reopen if I've got this wrong.
If you're getting ValueErrors when referencing values['name'] I would suggest a patch to check if 'name' in values and values['name'] in self.config['blacklist'] feel free to reopen if I've got this wrong.
That's exactly the problem I'm having. I'll rework this as you suggested.
If we couldn't scan the pokemon, we probably don't have the name, and when that happens things crash because there is no name key in the values returned.