-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
Set car sensors state appropriately if sensor registers with unit of measurement #3764
Set car sensors state appropriately if sensor registers with unit of measurement #3764
Conversation
Wouldn't
Not sure I agree for a string like this, especially considering core/frontend focus recently on making sure everything can be translated. |
We can't translate state strings in the app they need to be translated in core for the integration. I think there might be an old issue where we discussed this before. |
Yes so I would avoid strings that need translation like these :) |
Lol we don't need to avoid them. We are fine with using English. Someone who is skilled enough needs to add support so the states can be translated. iOS has the same issue. We are actually supposed to keep everything in English because the companion app docs are in English. It makes it easy to find sensors and other things we mention. |
Hadn't heard that one before but considering the limitations it makes sense. Note about unavailable / inconsistency is still relevant I think. |
can't seem to find it now but I remember Paulus telling us what we needed to do if we wanted custom states translated which involved updating
agreed, its fixed and should be more consistent now.
|
Thanks for your patience while I also figure out what is a good approach here 🙏 Now that it is easy to follow, should it maybe be mentioned in the docs that |
Agreed, updated docs to mention both |
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.
Good to get this in before a release so a breaking change is prevented :)
Summary
Fixes #3762
When a sensor has a unit of measurement HA will expect certain states if non-numerical otherwise the sensor will not be added.
By default when we do not have
carInfo
the state will beunavailable
. After the app is open user will either see the real state orunknown
if the status is notsuccess
. All sensors will show thestatus
attribute which will show the status of the sensor.As the sensors get triggered by a listener we can safely call
forceUpdate = true
we either get a real state or we are getting a real status of the value to send to the user.Removed the old string because we actually should not translate the states that we send, missed this in the original review 😬
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#969
Any other notes