-
Notifications
You must be signed in to change notification settings - Fork 21
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
Full-featured sensors for buying and selling #72
Conversation
You've made changes in Btw is there a reason why you made so many changes not relevant to the topic in one commit? |
|
I have checked many times that generated entity_id and uniqe_id are same as version 0.5.2. I may take a look at it over the weekend and double check to be sure.
I was developing it against version 0.5.2 and the change is huge. Unfortunately, before I got to PR, @rnovacek merged your entities modernization and when I did the rebase, I had to rework the whole thing. During rework I had to solve a number of issues, including the one you address in #74, and also that the entity_ids were generated based on the localized entity names. |
Without it, entity_ids are generated from localized entity names :-( |
And that’s absolutely normal and expected behaviour. |
You’ve added |
This is because both version 0.6.4 and your modified entities use lowercase unique_ids. |
I don't understand. However you've modified unique_id (see https://github.com/rnovacek/homeassistant_cz_energy_spot_prices/pull/72/files#diff-e513f41036a445059cb6bcd3e04d77008230c70ae2314434c4c9eb3ddc6408bcR107) and it's BC break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Couple of nitpicks, nothing serious. We just need to make sure we maintain compatibility with older releases, could you double check that?
I think the changes to unique_ids are only in unreleased |
It will break my installation but ok I understand your position. However I think this is still wrong: https://github.com/rnovacek/homeassistant_cz_energy_spot_prices/pull/72/files#diff-e513f41036a445059cb6bcd3e04d77008230c70ae2314434c4c9eb3ddc6408bcR213 |
0590d95
to
bb18eed
Compare
Quite the opposite. Entities will retain their original English
No. The I would leave the decision to @rnovacek on whether to localize |
Let me try to explain it better. Each sensor class generates three sensors for spot prices, purchase prices, and selling prices. The prices used in the sensor are determined by the |
I had installed the integration before my PR with translations and I still have english entity ids. Only new user should have the new localized entity ids because there are generated only for new entities.
Native HA integrations mostly don't because localized entity ids are expected - there are more user-friendly.
I've checked the HA core and you are probably right because there are some integration (minority of integrations) that use the same pattern. I have to admit I was not expected this and I was also wrong. |
I understand your reasons. I'm just not happy you've changed ids for binary sensors because it's BC break - yes, maybe only for me because I use |
I looked into the HEAD, and both the original sensors and the new binary sensors use only lowercase letters in the |
The problem is that you've changed the id. |
OK, I hope I finally understand what bothers you. The issue isn't with using |
I think the unique id is relevent only inside each platform. I’m not sure about it (not sure where in HA core to check) but I expect it because there’s now problem with current ids in my installation :) |
I rechecked the unique_id and entity_id against version v0.6.4, but this time on a fresh installation of Home Assistant. I found four errors in the entity_id that I missed last time. I fixed them, and now all sensors from version v0.6.4 have the same unique_id and entity_id, regardless of localization. It might be necessary to adjust and add tests, but that's beyond my abilities. |
The entity registry is stored in the file .storage/core.entity_registry in the configuration directory. It lists all entities regardless of their type. Try installing the Spooky integration, which should help uncover any issues. |
I've checked HA core sources and it looks the unique_id has to be unique only in the current domain and platform. And see these lines copied from my
|
My understanding of the internal logic of Home Assistant doesn't allow me to determine whether the |
I would be happy if the previous version can be preserved and my installation is not broken ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, this was on my list for too long.
Sorry for the late review, it's really bad with my free time lately.
While I agree that breaking compatibility is not perfect, it's most important not to break compatibility between release versions. I'm afraid we won't be able to make the main
branch compatible between all commits.
hour
variable to the buying and selling price templates.Example buying template with
EG.D Distribuce
distribution tariff sensor:Fixies: