Fixed the getelementpropertieswithtype
This commit is contained in:
2
main.py
2
main.py
@@ -522,7 +522,7 @@ async def fast_get_link_properties(network: str, link: str) -> dict[str, Any]:
|
|||||||
# type can be 'node' or 'link' or 'scada'
|
# type can be 'node' or 'link' or 'scada'
|
||||||
@app.get('/getelementpropertieswithtype/')
|
@app.get('/getelementpropertieswithtype/')
|
||||||
async def fast_get_element_properties_with_type(network: str, type: str, element: str) -> dict[str, Any]:
|
async def fast_get_element_properties_with_type(network: str, type: str, element: str) -> dict[str, Any]:
|
||||||
return get_element_properties(network, type, element)
|
return get_element_properties_with_type(network, type, element)
|
||||||
|
|
||||||
# type can be 'node' or 'link' or 'scada'
|
# type can be 'node' or 'link' or 'scada'
|
||||||
@app.get('/getelementproperties/')
|
@app.get('/getelementproperties/')
|
||||||
|
|||||||
@@ -423,11 +423,13 @@ def get_link_properties(name: str, link_id: str) -> dict[str, Any]:
|
|||||||
return api.get_valve(name, link_id)
|
return api.get_valve(name, link_id)
|
||||||
|
|
||||||
# type can be 'node' or 'link'
|
# type can be 'node' or 'link'
|
||||||
def get_element_properties(name: str, type: str, element_id: str) -> dict[str, Any]:
|
def get_element_properties_with_type(name: str, type: str, element_id: str) -> dict[str, Any]:
|
||||||
if type == 'node':
|
if type == 'node':
|
||||||
return get_node_properties(name, element_id)
|
return get_node_properties(name, element_id)
|
||||||
elif type == 'link':
|
elif type == 'link':
|
||||||
return get_link_properties(name, element_id)
|
return get_link_properties(name, element_id)
|
||||||
|
elif type == 'scada':
|
||||||
|
return get_scada_info(name, element_id)
|
||||||
else:
|
else:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user