def get_alarms_customer(customer): installations = installationHandler.get_by_customer(customer.get('id')) alarms = 0 if installations: for installation in installations: alarms += get_alarms_installation(installation) return alarms
def get_warnings_customer(customer): installations = installationHandler.get_by_customer(customer.get('id')) warnings = 0 if installations: for installation in installations: warnings += get_warnings_installation(installation) return warnings
def get(customer_id): res = installationHandler.get_by_customer(customer_id) if res: statusHandler.set_status_for_installations(res) return OkResponse(res)