Skip to content

Update entity (state) & service model#211

Merged
GrandMoff100 merged 25 commits intoGrandMoff100:devfrom
kpustelnik:dev
Sep 3, 2025
Merged

Update entity (state) & service model#211
GrandMoff100 merged 25 commits intoGrandMoff100:devfrom
kpustelnik:dev

Conversation

@kpustelnik
Copy link
Contributor

Resolves #210

Copy link
Contributor Author

@kpustelnik kpustelnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding few comments regarding things I've added

@kpustelnik
Copy link
Contributor Author

@GrandMoff100 I've replaced | with Union. Can you retest please?

@kpustelnik
Copy link
Contributor Author

I've reworked the models in my sources as I've found the home assistant's internal class definitions. Will try to update the PR shortly.

@kpustelnik
Copy link
Contributor Author

@GrandMoff100 Apologies for the delay. I've adjusted the models. They should be pretty accurate now btw as I was basing on the homeassistant source code

@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (8633bbc) to head (2f42979).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #211      +/-   ##
==========================================
+ Coverage   97.24%   97.72%   +0.48%     
==========================================
  Files          25       25              
  Lines        1343     1629     +286     
==========================================
+ Hits         1306     1592     +286     
  Misses         37       37              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GrandMoff100
Copy link
Owner

GrandMoff100 commented Aug 24, 2025

@kpustelnik Yay! No worries.

I'm moving right now so I haven't been able to sit down at my workstation and give this PR the attention it deserves. I've started working on it locally and resolved some of your comments in my local changes. I should be able to finish up, rebase them on top of your most recent commits and get this PR finished sometime this week after I finish moving in tomorrow.

@kpustelnik
Copy link
Contributor Author

@GrandMoff100 Understandable. That's of course no problem; good luck with moving!

BTW just like mentioned before - HA service api can accept not only entity_id but also floor_id, label_id, device_id and area_id. Also I've not said that but those fields can either be strings (ids) or lists of strings. You may include multiple types of targets in a single service invocation.

GrandMoff100
GrandMoff100 previously approved these changes Sep 2, 2025
@GrandMoff100
Copy link
Owner

GrandMoff100 commented Sep 2, 2025

Now the last thing left to do is address the entity_id/label_id/area_id/device_id/etc. issue

@kpustelnik
Copy link
Contributor Author

@GrandMoff100 Tbh Id just remove the parameter and let users insert the target manually in the data.
Options are mentioned entity / floor / area / device / label id and can either be string or list of strings. Multiple targets may be included (eg. List of entities + floors). That's a lot that can be done and thus the suggestion.

@GrandMoff100
Copy link
Owner

It'll be slightly less convenient for the users to double check what parameters each service supports but that's alright I suppose. It is easy to implement and it's a simple solution.

GrandMoff100
GrandMoff100 previously approved these changes Sep 3, 2025
@GrandMoff100 GrandMoff100 merged commit a362100 into GrandMoff100:dev Sep 3, 2025
3 checks passed
@GrandMoff100
Copy link
Owner

There you go @kpustelnik. Finally merged!

@kpustelnik
Copy link
Contributor Author

Tysm! @GrandMoff100

@kpustelnik
Copy link
Contributor Author

@GrandMoff100 Shall the HAApi version be bumped? This seems like a major change to the lib. Wondering whether you're waiting for something more

@GrandMoff100
Copy link
Owner

Sure thing! I can definitely push out a new version

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.

[Library Bug] Advanced fields are not parsed properly

2 participants