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

Add typing and refactor code to simplify #27

Merged
merged 6 commits into from
Jun 6, 2022
Merged

Conversation

raman325
Copy link
Contributor

@raman325 raman325 commented May 20, 2022

OK so there were a couple of functional changes I made:

  • Renamed variables to use snake case
  • raise Exceptions in API request that we can catch in the integration to trigger failed updates, reauth, etc.
  • Made room_temperature a property instead of a function
  • Added some previous session score properties in parallel with the ones that exist for the current session for consistency

Every other change was to reduce the code complexity, reuse code where possible, etc. You can see in the tests that the values don't change in spite of the refactoring which was why I added the tests first

Renamed variables and raising an Exception will require changes in the integration to support which we can address when we bump the dependency upstream.

@raman325 raman325 marked this pull request as draft May 20, 2022 01:09
@raman325 raman325 marked this pull request as ready for review May 20, 2022 01:33
@raman325 raman325 changed the title Refactor code to simplify and reuse where possible Add typing and refactor code to simplify Jun 2, 2022
@mezz64 mezz64 merged commit 051cb7b into mezz64:master Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants