mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix automation describeCondition for number state type (#21052)
When using a number state condition in an automation, the UI used an incorrect evaluation when trying to describe the condition which made the label default to the default value. To fix this, I just changed the evaluation to check directly for `undefined` value.
This commit is contained in:
parent
562bc084f0
commit
c54acc9369
@ -901,7 +901,7 @@ const tryDescribeCondition = (
|
||||
)
|
||||
: undefined;
|
||||
|
||||
if (condition.above && condition.below) {
|
||||
if (condition.above !== undefined && condition.below !== undefined) {
|
||||
return hass.localize(
|
||||
`${conditionsTranslationBaseKey}.numeric_state.description.above-below`,
|
||||
{
|
||||
@ -912,7 +912,7 @@ const tryDescribeCondition = (
|
||||
}
|
||||
);
|
||||
}
|
||||
if (condition.above) {
|
||||
if (condition.above !== undefined) {
|
||||
return hass.localize(
|
||||
`${conditionsTranslationBaseKey}.numeric_state.description.above`,
|
||||
{
|
||||
@ -922,7 +922,7 @@ const tryDescribeCondition = (
|
||||
}
|
||||
);
|
||||
}
|
||||
if (condition.below) {
|
||||
if (condition.below !== undefined) {
|
||||
return hass.localize(
|
||||
`${conditionsTranslationBaseKey}.numeric_state.description.below`,
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user