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

Refactor occupancy specialization #31

Merged
merged 7 commits into from
Jul 8, 2024
Merged

Conversation

jaraco
Copy link
Owner

@jaraco jaraco commented Jul 8, 2024

  • Remove Moisture class, unused.
  • Refactored sensor specialization.
  • Removed Occupancy class.
  • Avoid indirection through 'generic_type' when resolving a Device subclass.
  • Reflect the generic_type from the class instead of manifesting it in the state.
  • Inline the initialization.
  • Add a docstring explaining Device.tags.

Instead of relying on a confusingly-named 'unknown' sentinel, moved these tags to the `Motion` type and gave that type a `.specialize` method to handle the state-sensitive specialization.

Now a truly "unknown" device will resolve to `Unknown` and will be filtered when loading devices.

Closes #28
It seems to provide little value over the Motion class. Ref #28
@jaraco jaraco merged commit 318f302 into main Jul 8, 2024
26 checks passed
@jaraco jaraco deleted the refactor/occupancy-specialization branch July 8, 2024 11:23
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.

1 participant