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

Area Devices + Major code refactor #300

Merged
merged 10 commits into from
Feb 4, 2024
Merged

Area Devices + Major code refactor #300

merged 10 commits into from
Feb 4, 2024

Conversation

jseidl
Copy link
Owner

@jseidl jseidl commented Feb 1, 2024

This PR introduces Area Devices, a feature requested by the community that makes each area have it's own devices and allowing users to manage all Magic Areas entities for that area through that device.

image

This will enable a future change in the Meta-Areas behavior where current it tracks it's child areas' entities instead of the "magic entities". Now that MA is able to know which entities are theirs (by checking the device info) we can track them directly.

Secondly, there's a MAJOR code refactor going on. Up to the current release, Magic Areas code has been piled up with different levels of knowledge (from myself) since "I have no idea what I'm doing" to today's "I have some idea what I'm doing". Given that, the code wasn't particularly efficient nor abiding by the components standards, a lot of stuff was being done dumbly and I wanted to take some time to go through all of it and make it better. This refactor will (hopefully) have no impact in users but it is increasing the quality of the integration by a lot.

I've tried to break down the code into more reusable components and things should be more consistent and stable throughout.

@jseidl jseidl added feature enhancement Enhancement of existing feature labels Feb 1, 2024
@jseidl jseidl self-assigned this Feb 1, 2024
@jseidl
Copy link
Owner Author

jseidl commented Feb 1, 2024

Bug with the features entity loading is fixed. Was a race condition when the area was not ready. Wrapped all entity creation into a listener that listens for their area "area ready event" then proceeds.

This bug was introduced when I moved the platform setup out of the area initialization code (it should be where the whole integration is setup). Fortunately that's sorted out, on to the next things!

I'll spend tonight going over whatever else is can be optimized and merge so I can work on the other bugfixes.

@jseidl
Copy link
Owner Author

jseidl commented Feb 4, 2024

All features tested over the past 2 days, everything seems to be working. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant