This commit is contained in:
G Johansson 2024-07-12 17:14:55 +00:00
parent ebb450db48
commit 42fe1d6097
2 changed files with 16 additions and 9 deletions

View File

@ -78,16 +78,18 @@ async def get_options_schema(handler: SchemaCommonFlowHandler) -> vol.Schema:
def _is_valid_data_points(check_data_points: list[str]) -> bool:
"""Validate data points."""
result = False
for data_point in check_data_points:
if data_point.find(",") > 0:
if not data_point.find(",") > 0:
return False
values = data_point.split(",", maxsplit=1)
for value in values:
try:
float(value)
except ValueError:
return False
return True
return False
result = True
return result
async def validate_options(

View File

@ -73,5 +73,10 @@
}
}
}
},
"exceptions": {
"setup_error": {
"message": "Setup of {title} could not be setup due to {error}"
}
}
}