Conversation
There was a problem hiding this comment.
Are we sure this should be in the repo?
| .filter(and_(DB_Actuator.deletion_date.is_(None), DB_Actuator.enabled.is_(True))) | ||
| .all() | ||
| ) | ||
| return [Mapper.map_db_actuator_to_actuator(x) for x in result] |
There was a problem hiding this comment.
Maybe:
any(Mapper.map_db_actuator_to_actuator(x) for x in result)
?
There was a problem hiding this comment.
need Iterable not a boolean
| user = verify_token(x_access_token) | ||
| if user.role != "Admin": |
There was a problem hiding this comment.
Sorry, there's no need to check if user is not None. Hence, grouping the two lines using the := operator can be avoided.
wadas_webserver/web_server_app.py
Outdated
|
|
||
| battery_status = Database.instance.get_last_battery_status(actuator_id) | ||
| temp_data = Database.instance.get_last_temperature_status(actuator_id) | ||
| temperature, humidity = temp_data if temp_data else (None, None) |
There was a problem hiding this comment.
temperature, humidity = temp_data or (None, None)
| export async function fetchActuatorLogs(actuatorId : string): Promise<ActuatorLogsResponse> { | ||
| return await apiPOST(baseUrl.concat("api/v1/actuators/"+actuatorId+"/log"), (response : any) => { | ||
| return response.json(); | ||
| }); | ||
| } |
There was a problem hiding this comment.
The coding style is different from the previous code. For example, there's extra space before the : in the parameters definition. Or there are missing spaces around the + operator.
| user = verify_token(x_access_token) | ||
| if user.role != "Admin": |
There was a problem hiding this comment.
Sorry, there's no need to check if user is not None. Hence, grouping the two lines using the := operator can be avoided.
Added logi for proividing Actuator informations, still need post logic for tests