mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fixes
This commit is contained in:
parent
ebb450db48
commit
42fe1d6097
@ -78,16 +78,18 @@ async def get_options_schema(handler: SchemaCommonFlowHandler) -> vol.Schema:
|
|||||||
|
|
||||||
def _is_valid_data_points(check_data_points: list[str]) -> bool:
|
def _is_valid_data_points(check_data_points: list[str]) -> bool:
|
||||||
"""Validate data points."""
|
"""Validate data points."""
|
||||||
|
result = False
|
||||||
for data_point in check_data_points:
|
for data_point in check_data_points:
|
||||||
if data_point.find(",") > 0:
|
if not data_point.find(",") > 0:
|
||||||
values = data_point.split(",", maxsplit=1)
|
return False
|
||||||
for value in values:
|
values = data_point.split(",", maxsplit=1)
|
||||||
try:
|
for value in values:
|
||||||
float(value)
|
try:
|
||||||
except ValueError:
|
float(value)
|
||||||
return False
|
except ValueError:
|
||||||
return True
|
return False
|
||||||
return False
|
result = True
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
async def validate_options(
|
async def validate_options(
|
||||||
|
@ -73,5 +73,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"exceptions": {
|
||||||
|
"setup_error": {
|
||||||
|
"message": "Setup of {title} could not be setup due to {error}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user