-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Make triggers and condition for monetary sensor consistent #131184
base: dev
Are you sure you want to change the base?
Conversation
Since March 2023 the sensor type 'monetary' has the friendly name "Balance" (in the sense of an account balance). The corresponding trigger and condition strings, however, were not matched and called "money" instead. This is not only inconsistent, it also does not make any sense to say When {entity_name} money changes or Current {entity_name} money Both make sense with "balance" only.
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -23,7 +23,7 @@ | |||
"is_illuminance": "Current {entity_name} illuminance", | |||
"is_irradiance": "Current {entity_name} irradiance", | |||
"is_moisture": "Current {entity_name} moisture", | |||
"is_monetary": "Current {entity_name} money", | |||
"is_monetary": "Current {entity_name} balance", |
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.
This device class doesn't represent a total, thus cannot be a balance.
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.
Well, I mentioned it at the very top of my PR, the 'monetary' entity class is named "Balance":
core/homeassistant/components/sensor/strings.json
Lines 210 to 211 in d854940
"monetary": { | |
"name": "Balance" |
That is also how it is listed as device class when creating a Random helper:
So this is the current balance on some (virtual) account.
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.
Now if that is called "Balance", a trigger "when xyz money changes" and a condition "if xyz money is above / below …" does not make sense.
But a trigger "when xyz balance changes" and a condition "if xyz balance is above / below …" sound like the logical way to work with such a device class.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Since March 2023 the sensor type 'monetary' has the friendly name "Balance" (in the sense of an account balance):
core/homeassistant/components/sensor/strings.json
Lines 210 to 211 in d854940
The corresponding trigger and condition strings, however, were not matched and called "money" instead.
This is not only inconsistent, it also does not make any sense to say
or
Both make sense with "balance" only.
Proposed change
Replace "money" in both strings with "balance".
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: