legge variabile singola

This commit is contained in:
boyska 2023-07-02 17:05:46 +02:00
parent b40c8c3a10
commit 10d20d625e

View file

@ -101,6 +101,10 @@ async def push_message(
async def get_all_variables() -> AllVariablesModel:
return settings.variables
@app.get("/variable/{key}")
async def get_variable(key: str) -> VariableModel:
return Response(str(settings.variables[key]), media_type='text/plain')
def first_matching(lst: list, condition: Callable[[Any], bool]) -> int:
"""return the index of the first item that matches condition"""