Get all scada devices
This commit is contained in:
@@ -15,6 +15,14 @@ def get_scada_device_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
'sd_type': {'type': 'str', 'optional': True , 'readonly': False}}
|
||||
|
||||
|
||||
def get_scada_devices(name: str) -> list[str]:
|
||||
result : list[str] = []
|
||||
rows = read_all(name, 'select id from scada_device order by id')
|
||||
for row in rows:
|
||||
result.append(str(row['id']))
|
||||
return result
|
||||
|
||||
|
||||
def get_scada_device(name: str, id: str) -> dict[str, Any]:
|
||||
sm = try_read(name, f"select * from scada_device where id = '{id}'")
|
||||
if sm == None:
|
||||
|
||||
Reference in New Issue
Block a user