mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +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:
|
||||
"""Validate data points."""
|
||||
result = False
|
||||
for data_point in check_data_points:
|
||||
if data_point.find(",") > 0:
|
||||
values = data_point.split(",", maxsplit=1)
|
||||
for value in values:
|
||||
try:
|
||||
float(value)
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
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
|
||||
result = True
|
||||
return result
|
||||
|
||||
|
||||
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