Some improvements and cleanup
Hello,
a few weeks ago, I wanted to add my children's EasyIQ ugeplan to my dashboard and came across this integration, but the ugeplan didn't seem to work for me at that point. Long story short, I ended up tinkering with this probably a bit too much :)
This PR is a pretty monster one, but it's mostly for "hello, I'm here!" purposes. I am happy to help split this out into smaller chunks, if you feel that any of these contributions would be welcome.
Improvements and changes:
- added options to split EasyIQ ugeplan into separate attributes (week plan + events), so I can style the display in a Markdown card myself, instead of relying on the hardcoded formatting (I could also do this for other widgets, maybe this could help with some of MinUddannelse cases where there are two sources of ugeplan)
- added an option to add EasyIQ classes to the calendar
- added types to a lot of the code and ran the integration through MyPy and Ruff, cleaning up the errors and most of the warnings
- added an enum and translations to child status
- moved all of the updates to a single DataUpdateCoordinator that refreshes all entities
- removed the calendar's use of file system to pass data between the Client class and the Caledar entity
- I also moved the CalendarData class around a bit to keep it in the Client and the Calendar then reads from it
- added the reconfiguration flow (not the options flow, I removed all of that dead code)
This looks awesome! :)
Do you think you can get the latest changes from main's client.py into your PR? This was a rollback of some functionality which broke the integration for a lot of ppl.
This looks awesome! :)
Do you think you can get the latest changes from main's client.py into your PR? This was a rollback of some functionality which broke the integration for a lot of ppl.
Ah, maybe you already did that..
I merged those changes by hand, because I already moved quite a bit of code.
I merged those changes by hand, because I already moved quite a bit of code.
Okay I see. I am just noticing the merge conflict with client.py which could indicate, that your changes are older than the ones on main?
@bogolob Thanks for your effort in improving this integration! However, this Pull Request includes quite a few changes, including some files unrelated to the integration, such as .vscode/launch.json and mypy.ini. To make the review process smoother, it's a good idea to focus each Pull Request on a single feature or improvement. Could you consider splitting this into smaller PRs, each addressing a specific feature or change? This will make it easier to review and get your changes approved faster.