Skip to content
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

GREEN_PIPS = 10 missing from ValueUIStyle enumerator #131

Closed
GregShiner opened this issue Feb 11, 2022 · 3 comments · Fixed by #132
Closed

GREEN_PIPS = 10 missing from ValueUIStyle enumerator #131

GregShiner opened this issue Feb 11, 2022 · 3 comments · Fixed by #132
Labels
bug Something isn't working

Comments

@GregShiner
Copy link
Contributor

GregShiner commented Feb 11, 2022

Long story short.

The enumeration for GreenPips is not in the ValueUIStyle enumerator.

Expected Result

The value 10 would be enumerated to GREEN_PIPS

Actual Result

This bug causes a ValueError when you try to enumerate 10.

  File "/home/gman1230321/bountyoptimizer/Bounty-Optimization-Tool/app.py", line 53, in getCharacters
    objectives = [await objective.fetch_self() for objective in objectives]
  File "/home/gman1230321/bountyoptimizer/Bounty-Optimization-Tool/app.py", line 53, in <listcomp>
    objectives = [await objective.fetch_self() for objective in objectives]
  File "/home/gman1230321/bountyoptimizer/Bounty-Optimization-Tool/lib/python3.9/site-packages/aiobungie/crate/records.py", line 111, in fetch_self
    return await self.net.request.fetch_objective_entity(self.hash)
  File "/home/gman1230321/bountyoptimizer/Bounty-Optimization-Tool/lib/python3.9/site-packages/aiobungie/client.py", line 939, in fetch_objective_entity
    return self.factory.deserialize_objective_entity(resp)
  File "/home/gman1230321/bountyoptimizer/Bounty-Optimization-Tool/lib/python3.9/site-packages/aiobungie/internal/factory.py", line 1702, in deserialize_objective_entity
    progress_value_style=entity.ValueUIStyle(payload["inProgressValueStyle"]),
  File "/usr/lib/python3.9/enum.py", line 360, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.9/enum.py", line 678, in __new__
    raise ve_exc
ValueError: 10 is not a valid ValueUIStyle

System info

Ubuntu 20.04 on WSL
Python 3.9.5
aiobungie 0.2.5

Further info

The solution is incredibly simple. Just add GREEN_PIPS = 10 to class ValueUIStyle(enums.IntEnum): in crate.entity.py. I've attached a patch file that will solve this issue. I'm having trouble right now getting a development copy on my system so I can't just submit a PR at this moment. Just apply the patch to crate/entity.py with patch crate/entity.py < patch.txt
patch.txt

@GregShiner GregShiner added the bug Something isn't working label Feb 11, 2022
@GregShiner
Copy link
Contributor Author

Additionally, here is the Bungie.net API documentation for this enumerator for reference. https://bungie-net.github.io/#/components/schemas/Destiny.DestinyUnlockValueUIStyle

@GregShiner
Copy link
Contributor Author

GregShiner commented Feb 11, 2022

I made a PR just using the GitHub built-in editor but I have not been able to run tests since I cannot get my environment to work properly.

@nxtlo nxtlo linked a pull request Feb 11, 2022 that will close this issue
2 tasks
@nxtlo
Copy link
Owner

nxtlo commented Feb 11, 2022

Thanks for catching that, Will take a look at the PR now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants